Skip to content

Commit

Permalink
fix: flaky test tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Dec 18, 2024
1 parent 7cacc10 commit 0b57b71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_channels/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def test_pub_sub_non_blocking(channels_backend: ChannelsBackend, channel:
subscriber = await plugin.subscribe(channel)
plugin.publish(b"foo", channel)

await asyncio.sleep(0.1) # give the worker time to process things
await asyncio.sleep(0.5) # give the worker time to process things

res = await get_from_stream(subscriber, 1)

Expand Down Expand Up @@ -156,7 +156,7 @@ async def test_ws_route_handlers_receive_arbitrary_message(channels_backend: Cha


@pytest.mark.flaky(reruns=15)
def test_create_ws_route_handlers_arbitrary_channels_allowed(channels_backend: ChannelsBackend) -> None:
async def test_create_ws_route_handlers_arbitrary_channels_allowed(channels_backend: ChannelsBackend) -> None:
channels_plugin = ChannelsPlugin(
backend=channels_backend,
arbitrary_channels_allowed=True,
Expand All @@ -171,7 +171,7 @@ def test_create_ws_route_handlers_arbitrary_channels_allowed(channels_backend: C
channels_plugin.publish("something", "foo")
assert ws.receive_text(timeout=2) == "something"

time.sleep(0.1)
time.sleep(0.5)

with client.websocket_connect("/ws/bar") as ws:
channels_plugin.publish("something else", "bar")
Expand Down
12 changes: 6 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b57b71

Please sign in to comment.