Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/utils/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ async def _hold_condition():
task = asyncio.ensure_future(_hold_condition())
await asyncio.sleep(0.1)

async with test_cond:
await aioutils.wait_condition_or_timeout(test_cond, 0.1)
async def _async_wait_or_timeout():
async with test_cond:
await aioutils.wait_condition_or_timeout(test_cond, 0.1)

# Test high lock contention
await asyncio.gather(*[_async_wait_or_timeout() for _ in range(100)])

task.cancel()
with contextlib.suppress(asyncio.CancelledError):
Expand Down