From 4af847b2e25667ae227a47ba633d03561065dd13 Mon Sep 17 00:00:00 2001 From: Danijar Hafner Date: Tue, 17 Sep 2024 20:10:24 +0000 Subject: [PATCH] Deflake tests --- tests/test_server.py | 6 +++--- tests/test_socket.py | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_server.py b/tests/test_server.py index 8d0a7c6..4b83b82 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -218,7 +218,7 @@ def fast(x): # The slow request is processed first, so this will wait until both # requests are done. fast_future.result() - assert slow_future.wait(0.01) + assert slow_future.wait(0.1) server.close() client.close() @@ -244,7 +244,7 @@ def fast(x): # Both requests are processed in parallel, so the fast request returns # before the slow request is done. fast_future.result() - assert not slow_future.wait(0.01) + assert not slow_future.wait(0.1) server.close() client.close() @@ -313,7 +313,7 @@ def test_client_drops(self, repeat, Server): def fn(x): if x == 1: barrier.wait() - time.sleep(0.2) + time.sleep(0.5) return x port = portal.free_port() diff --git a/tests/test_socket.py b/tests/test_socket.py index 59438b9..96b71a6 100644 --- a/tests/test_socket.py +++ b/tests/test_socket.py @@ -11,8 +11,6 @@ def test_basic(self, ipv6): port = portal.free_port() server = portal.ServerSocket(port, ipv6=ipv6) client = portal.ClientSocket(port, ipv6=ipv6) - client.connect() - assert client.connected client.send(b'foo') addr, data = server.recv() assert addr[0] == '::1' if ipv6 else '127.0.0.1'