https://github.com/python/cpython/commit/1056f38b3a94c5024d31d7acf4d6c5fd28f0059b
commit: 1056f38b3a94c5024d31d7acf4d6c5fd28f0059b
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: vstinner <vstin...@python.org>
date: 2024-11-29T11:01:59Z
summary:

[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() 
(GH-127358) (#127401)

gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)

Replace the sleep(2) with a task which is blocked forever.
(cherry picked from commit bfabf96b50b7d6a9c15b298a86ba3633b05a1fd7)

Co-authored-by: Victor Stinner <vstin...@python.org>

files:
M Lib/test/test_asyncio/test_eager_task_factory.py

diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py 
b/Lib/test/test_asyncio/test_eager_task_factory.py
index 31d2a00dbb8c9c..0e2b189f761521 100644
--- a/Lib/test/test_asyncio/test_eager_task_factory.py
+++ b/Lib/test/test_asyncio/test_eager_task_factory.py
@@ -220,10 +220,14 @@ async def fail():
             await asyncio.sleep(0)
             raise ValueError("no good")
 
+        async def blocked():
+            fut = asyncio.Future()
+            await fut
+
         async def run():
             winner, index, excs = await asyncio.staggered.staggered_race(
                 [
-                    lambda: asyncio.sleep(2, result="sleep2"),
+                    lambda: blocked(),
                     lambda: asyncio.sleep(1, result="sleep1"),
                     lambda: fail()
                 ],

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to