10000 [3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) by miss-islington · Pull Request #127401 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2024
Merged
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
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 bfabf96)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed Nov 29, 2024
commit 1de25b4b40d4169f0bae711866b17426f21bed76
6 changes: 5 additions & 1 deletion Lib/test/test_asyncio/test_eager_task_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
],
Expand Down
Loading
0