GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_staggered_race_with_eager_tasks fails with CancelledError · Issue #158097 · python/cpython

test_staggered_race_with_eager_tasks fails with CancelledError #158097

New issue
Copy link
New issue
Copy link
Closed
#158469
Closed
test_staggered_race_with_eager_tasks fails with CancelledError#158097
#158469
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@rossburton
rossburton
opened on Sep 24, 2026
Issue body actions

Bug report

Bug description:

We're occasionally seeing test.test_asyncio.test_eager_task_factory.PyEagerTaskFactoryLoopTests.test_staggered_race_with_eager_tasks fail:

Traceback (most recent call last):
  File "/usr/lib/python3.14/test/test_asyncio/test_eager_task_factory.py", line 242, in test_staggered_race_with_eager_tasks
    self.run_coro(run())
    ~~~~~~~~~~~~~^^^^^^^
  File "/usr/lib/python3.14/test/test_asyncio/test_eager_task_factory.py", line 36, in run_coro
    return self.loop.run_until_complete(coro)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.14/asyncio/base_events.py", line 720, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/asyncio/futures.py", line 208, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/lib/python3.14/asyncio/tasks.py", line 289, in __step_run_and_handle_result
    result = coro.send(None)
  File "/usr/lib/python3.14/test/test_asyncio/test_eager_task_factory.py", line 240, in run
    self.assertIsInstance(excs[2], ValueError)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
AssertionError: CancelledError() is not an instance of <class 'ValueError'>

This is rarely happening, but we've seen it in CI runs of the Python test suite (OpenEmbedded, Python 3.14.7).

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

  • gh-158097: Make test_staggered_race_with_eager_tasks deterministic #158469
  • [3.15] gh-158097: Make test_staggered_race_with_eager_tasks deterministic (GH-158469) #161223
  • [3.14] gh-158097: Make test_staggered_race_with_eager_tasks deterministic (GH-158469) #161224

Activity

  1. rossburton
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Sep 24, 2026
  2. aisk
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-asyncio
    on Sep 24, 2026
  3. github-project-automation
    added this to asyncioon Sep 24, 2026
  4. github-project-automation
    moved this to Todo in asyncioon Sep 24, 2026
  5. seth-957
    added 2 commits that reference this issue on Sep 24, 2026

    Fix race condition in asyncio.staggered_race (pythongh-158097)

    7ab0028

    Fix race condition in asyncio.staggered_race (pythongh-158097)

    2fbbee6
  6. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  7. github-project-automation
    moved this to Todo in Project_VKon Oct 18, 2026
  8. github-project-automation
    moved this from Todo to In progress in Project_VKon Oct 18, 2026
  9. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  10. asvetlov
    added a commit that references this issue on Nov 2, 2026

    gh-158097: Make test_staggered_race_with_eager_tasks deterministic (#…

    3945eaf
  11. asvetlov
    closed this as completedin #158469on Nov 2, 2026
  12. github-project-automation
    moved this from Todo to Done in asyncioon Nov 2, 2026
  13. asvetlov
    added 2 commits that reference this issue on Nov 2, 2026

    [3.15] gh-158097: Make test_staggered_race_with_eager_tasks determini…

    39aa513

    [3.14] gh-158097: Make test_staggered_race_with_eager_tasks determini…

    b6e398e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dirtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • asyncio
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.