You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert what the deadline guard guarantees, not where CPython delivers it
The 3.13 leg failed on two tests that count swallowed interrupts. Both were
asserting on where an asynchronous exception lands, which CPython explicitly
does not guarantee. Measured over six identical main-thread runs the count came
out 1, 1, 1, 2, 2 and 4; over four worker-thread runs, 0, 0, 1 and 2. The
escaping one came from inside the signal handler. That is a coin toss, and it is
why 3.12 and 3.14 stayed green while 3.13 went red.
The helper now records swallows for diagnosis and reports `interrupted`, which is
deterministic: it always ends by raising, either because a re-armed interrupt
landed somewhere the node could not catch or because the guard's exit check
fired. The tests assert that an interrupt reached the thread and that the node —
which asked for five seconds — was stopped in a fraction of one. A guard that
fired once into a node that swallows cannot produce the second fact, because the
node would have gone back to spinning with nothing left to stop it.
This is a weaker assertion than "it fired more than once" and I would rather say
so than pretend otherwise. The property under test — the ceiling reaches a pool
thread and keeps firing until the node stops — is still pinned. What is no
longer pinned is the delivery site, which was never ours to promise.
Verified: 12 consecutive green runs of the file on 3.13, and the full suite on
3.12, 3.13 and 3.14.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments