why test_can_open_and_close_connection fails sometimes
@@ -27,12 +27,19 @@ def test_can_open_and_close_connection(tcp_connection_class,
(tcp_server, tcp_server_pipe) = integration_tcp_server_and_pipe
moler_conn = ObservableConnection()
+ print("TCOACC: 1")
connection = tcp_connection_class(moler_connection=moler_conn, port=tcp_server.port, host=tcp_server.host)
+ print("TCOACC: 2")
connection.open()
+ print("TCOACC: 3")
connection.close()
- time.sleep(0.1) # otherwise we have race between server's pipe and from-client-connection
+ print("TCOACC: 4")
+ time.sleep(0.01) # otherwise we have race between server's pipe and from-client-connection
+ print("TCOACC: 5")
tcp_server_pipe.send(("get history", {}))
+ print("TCOACC: 6")
dialog_with_server = tcp_server_pipe.recv()
+ print("TCOACC: 7")
assert 'Client connected' in dialog_with_server
assert 'Client disconnected' in dialog_with_server
