mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
fix test_serverStopsWhileConnected
This commit is contained in:
parent
13fc8460b2
commit
0445dc38cc
|
|
@ -122,5 +122,7 @@ class TCPClient:
|
|||
self._sock.sendall(bytes(header + aliveMsg, "utf-8"))
|
||||
return True
|
||||
except (AttributeError, BrokenPipeError):
|
||||
logging.exception("Unknown error: ")
|
||||
except ConnectionResetError:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -164,9 +164,12 @@ def test_serverStopsWhileConnected(getRunningServer, getClient):
|
|||
"""!Shutdown server while client is connected"""
|
||||
getClient.connect()
|
||||
getRunningServer.stop()
|
||||
time.sleep(0.1)
|
||||
assert getClient.isConnected # todo check why the first always return true here
|
||||
assert not getClient.isConnected
|
||||
timeout = 10
|
||||
while getClient.isConnected:
|
||||
print(timeout)
|
||||
timeout = timeout - 1
|
||||
if timeout is 0:
|
||||
assert 0
|
||||
|
||||
|
||||
@pytest.mark.skip("needs fixture for more than one client")
|
||||
|
|
|
|||
Loading…
Reference in a new issue