Skip to content

Commit

Permalink
Fix falling tests on windows due to very low timer precision
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Oct 15, 2024
1 parent a7414f1 commit 9066bdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_autoping.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ async def test_no_ping_when_data_is_present():

async with ServerAsyncContext(server) as server_ctx:
async with ClientAsyncContext(AccumulatingListener, server_ctx.plain_url, enable_auto_pong=False) as (transport, listener):
for i in range(100):
await asyncio.sleep(0.01)
for i in range(10):
await asyncio.sleep(0.05)
transport.send(picows.WSMsgType.TEXT, b"hi")

assert len(listener.frames) == 0
Expand All @@ -202,8 +202,8 @@ def on_ws_frame(self, transport: picows.WSTransport, frame: picows.WSFrame):

async with ServerAsyncContext(server) as server_ctx:
async with ClientAsyncContext(ClientListener, server_ctx.plain_url, enable_auto_pong=False) as (transport, listener):
for i in range(100):
await asyncio.sleep(0.01)
for i in range(10):
await asyncio.sleep(0.05)
transport.send(picows.WSMsgType.TEXT, b"hi")

assert len(listener.frames) >= 3
Expand Down

0 comments on commit 9066bdd

Please sign in to comment.