From 6eeca7fb0dd1774a7aa412600bc426b905c5781c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 25 Nov 2024 16:09:24 +0100 Subject: [PATCH] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() Use a longer sleep for the "sleep2" task, 60 seconds instead of 2 seconds, to make sure that "sleep1" task (1 second) is more likely to win the race. --- Lib/test/test_asyncio/test_eager_task_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py b/Lib/test/test_asyncio/test_eager_task_factory.py index 31d2a00dbb8c9c..1a8831a73a5d0d 100644 --- a/Lib/test/test_asyncio/test_eager_task_factory.py +++ b/Lib/test/test_asyncio/test_eager_task_factory.py @@ -223,7 +223,7 @@ async def fail(): async def run(): winner, index, excs = await asyncio.staggered.staggered_race( [ - lambda: asyncio.sleep(2, result="sleep2"), + lambda: asyncio.sleep(60, result="sleep2"), lambda: asyncio.sleep(1, result="sleep1"), lambda: fail() ],