Skip to content

flaky: test_external_cancellation_acomplete_raise_once failed once in merge-queue CI (3.13) #1132

@ajbozarth

Description

@ajbozarth

Logging this so we notice if it recurs.

What happened

test/stdlib/test_streaming.py::test_external_cancellation_acomplete_raise_once failed in the merge queue on Python 3.13 and kicked PR #1131 out of the queue: run 26259556019.

>       with pytest.raises(asyncio.CancelledError):
E       Failed: DID NOT RAISE <class 'asyncio.exceptions.CancelledError'>

test/stdlib/test_streaming.py:978: Failed

The same PR passed all three Python versions on the regular PR run, and its diff (a DCO commit-msg hook) is unrelated to streaming. Doesn't reproduce locally on macOS (30/30 passes).

One theory worth checking

The test sleeps 10 ms after launching the orchestrator before calling cancel(). StreamingMockBackend._feed_tokens only does await asyncio.sleep(0) between tokens, so on a fast runner it's at least conceivable that the orchestrator drains the whole stream within 10 ms — at which point cancel() no-ops on an already-done task. I haven't verified this; could also be a 3.13 asyncio scheduling quirk or a one-time CI hiccup.

If the theory holds, awaiting the first event from result.events() before cancelling would be a more robust gate than wall-clock sleep.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions