Skip to content

tests: the strand test's at-once cancel holds its lane until the cancel lands - #3355

Merged
ashhart merged 2 commits into
mainfrom
lead/strand-cancel-race
Nov 14, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/strand-cancel-race

Conversation

@ashhart

@ashhart ashhart commented Nov 14, 2026

Copy link
Copy Markdown
Owner

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 prompts
  • lane strand: 200 requests mixing every path, whole and stepped prompts

Both run the cancel_at_once path, 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 with length.

The at-once cancel now submits the paused holder request, 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 by cancel_decode, which cancels from the host's own first-tokens event, so it can't lose that race.

Checks: zig build test-lane-strand-host passes (39 of 39), and so do eight copies of the test binary run at the same time on one machine. zig fmt --check is clean, and the file stays at 600 lines.

🤖 Generated with Claude Code

…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
ashhart force-pushed the lead/strand-cancel-race branch from 53e5d0a to 9487ae7 Compare November 14, 2026 17:01
@ashhart
ashhart merged commit 855cb79 into main Nov 14, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/strand-cancel-race branch November 14, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant