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"))
|
self._sock.sendall(bytes(header + aliveMsg, "utf-8"))
|
||||||
return True
|
return True
|
||||||
except (AttributeError, BrokenPipeError):
|
except (AttributeError, BrokenPipeError):
|
||||||
|
logging.exception("Unknown error: ")
|
||||||
|
except ConnectionResetError:
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,12 @@ def test_serverStopsWhileConnected(getRunningServer, getClient):
|
||||||
"""!Shutdown server while client is connected"""
|
"""!Shutdown server while client is connected"""
|
||||||
getClient.connect()
|
getClient.connect()
|
||||||
getRunningServer.stop()
|
getRunningServer.stop()
|
||||||
time.sleep(0.1)
|
timeout = 10
|
||||||
assert getClient.isConnected # todo check why the first always return true here
|
while getClient.isConnected:
|
||||||
assert not getClient.isConnected
|
print(timeout)
|
||||||
|
timeout = timeout - 1
|
||||||
|
if timeout is 0:
|
||||||
|
assert 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip("needs fixture for more than one client")
|
@pytest.mark.skip("needs fixture for more than one client")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue