Skip to content

Commit 84af6c0

Browse files
committed
pythongh-127258: Fix asyncio test_staggered_race_with_eager_tasks()
Replace the sleep with a task which is blocked forever.
1 parent 3a77980 commit 84af6c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_asyncio/test_eager_task_factory.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,14 @@ async def fail():
220220
await asyncio.sleep(0)
221221
raise ValueError("no good")
222222

223+
async def blocked():
224+
fut = asyncio.Future()
225+
await fut
226+
223227
async def run():
224228
winner, index, excs = await asyncio.staggered.staggered_race(
225229
[
226-
lambda: asyncio.sleep(2, result="sleep2"),
230+
lambda: blocked(),
227231
lambda: asyncio.sleep(1, result="sleep1"),
228232
lambda: fail()
229233
],

0 commit comments

Comments
 (0)