diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py b/Lib/test/test_asyncio/test_eager_task_factory.py index 0561b54a3f19c6..72bceb8c31441b 100644 --- a/Lib/test/test_asyncio/test_eager_task_factory.py +++ b/Lib/test/test_asyncio/test_eager_task_factory.py @@ -217,7 +217,9 @@ def test_staggered_race_with_eager_tasks(self): # See https://github.com/python/cpython/issues/124309 async def fail(): - await asyncio.sleep(0) + # Raise without suspending: staggered_race() cancels unfinished + # coroutines once another one wins, so yielding first could turn + # this into a CancelledError when the event loop is busy. raise ValueError("no good") async def blocked():