Skip to content

test_staggered_race_with_eager_tasks fails with CancelledError #158097

Description

@rossburton

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

Activity

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 dirtopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions