Skip to content

test(protocols): the #1889 swallowed-raise test can see the deadline arrive without the swallow #1897

Closed

Description

@JarryShaw

tests/protocols/test_option_generator_deadline_scale_1428_unit.py::GeneratorDeadlineScaleTests::test_a_raise_that_never_reaches_the_body_is_repeated failed on main. It ran in the Python 3.13 job (117434732389) of Unit Tests run 39038572601, for d14a1b9, under xdist worker gw3:

>       self.assertEqual(spin.swallowed, 1)
E       AssertionError: 0 != 1
tests/protocols/test_option_generator_deadline_scale_1428_unit.py:256

The test arrived with #1891 (#1889). _Spin(swallow=1) should drop the first TimeoutError and let the repeat through. Here swallowed stayed 0: the test still came out interrupted, but no raise was dropped first. The cause is not yet known. The rest of that job passed (4440 tests), and the test passes locally, so it is intermittent. A flaky blocking test turns any PR red at random.

Fix: find why the first deadline can arrive without passing through the swallow path, and make the test deterministic. The fix must not weaken the assertion that a dropped raise is followed by another. Add a test that forces the interleaving, and check that it fails without the fix.

Activity

  1. added
    testPull requests that add or correct tests (test: subject prefix)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 17, 2026
  2. added 2 commits that reference this issue on Oct 17, 2026
  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 18, 2026
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

    testPull requests that add or correct tests (test: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions