Repository navigation
tests: the strand test's at-once cancel holds its lane until the cancel lands - #3355
Merged
Merged
Conversation
…el lands On a loaded runner the test thread could lose the CPU between submit and cancel for long enough that the fake engine's 4,096-token reply finished first, so the request ended with length, not cancelled (two strand tests red on train #3346). The request now pauses in its prompt pass until cancelled, as the queued-cancel test's blockers do; mid-decode cancels stay covered by cancel_decode, which cancels from the host's own first-tokens event.
ashhart
force-pushed
the
lead/strand-cancel-race
branch
from
November 14, 2026 17:01
53e5d0a to
9487ae7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two strand tests from #3015 went red on train #3346's zig job (
expected .cancelled, found .length):lane strand: 200 cancels at once, mid-prompt and mid-decode, whole and stepped promptslane strand: 200 requests mixing every path, whole and stepped promptsBoth run the
cancel_at_oncepath, which submits a 4,096-token request and then cancels it from the test thread. On a loaded CI runner the test thread can lose the CPU between the two calls for long enough that the fake engine finishes the whole reply, and the request then ends withlength.The at-once cancel now submits the paused
holderrequest, which stops in its prompt pass and keeps its lane until it is cancelled, as the queued-cancel test's blockers already do. Mid-decode cancels are still covered bycancel_decode, which cancels from the host's own first-tokens event, so it can't lose that race.Checks:
zig build test-lane-strand-hostpasses (39 of 39), and so do eight copies of the test binary run at the same time on one machine.zig fmt --checkis clean, and the file stays at 600 lines.🤖 Generated with Claude Code