Skip to content

Commit

Permalink
Deflake tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danijar committed Sep 17, 2024
1 parent aaac518 commit 4af847b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 4af847b

Please sign in to comment.