Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion Lib/test/test_asyncio/test_eager_task_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ def test_staggered_race_with_eager_tasks(self):
# See https://github.com/python/cpython/issues/124309

async def fail():
await asyncio.sleep(0)
# Fail without suspending first. staggered_race() awaits the
# coroutines inline and cancels every one of them that has not
# finished once another one wins, so a coroutine that yields before
# raising may be cancelled instead, and excs[2] would report a
# CancelledError. Raising right away keeps the outcome
# independent of how busy the event loop is.
raise ValueError("no good")

async def blocked():
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a rare flakiness in ``test_staggered_race_with_eager_tasks`` in
``test_asyncio``.
Loading