Repository navigation
test(session): park the replay-gap claimant deterministically before the reset - #13122
Merged
iamwhatever merged 1 commit intoSep 23, 2026
Merged
Conversation
…the reset test_a_woken_claimant_lands_behind_the_successor asserted its scenario -- a claimant ALREADY parked on the held lease when the reset lands -- with a 50 ms wall-clock sleep. On a loaded Windows runner the waiter task had not reached the semaphore in that window, so it was a different claimant (one that had passed the gap check but not yet parked) and the ordering assertion saw ['newer', 'replay'] (kirodotdev#13115). Wait for the park itself: poll the lease semaphore's waiter list, bounded, so the reset provably lands on a parked claimant, and keep the post-replay absence check generous (loop yields plus a short sleep) rather than tight. Closes kirodotdev#13115
Contributor
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Contributor
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the un-parked-claimant ordering question gets its own open tracker, since this PR closes #13115 where it was noted. [DESIGN-REVIEWED] 91126dc |
Contributor
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
iamwhatever
approved these changes
Sep 23, 2026
wknight1
pushed a commit
to wknight1/KiroCrew
that referenced
this pull request
Oct 5, 2026
…the reset (kirodotdev#13122) test_a_woken_claimant_lands_behind_the_successor asserted its scenario -- a claimant ALREADY parked on the held lease when the reset lands -- with a 50 ms wall-clock sleep. On a loaded Windows runner the waiter task had not reached the semaphore in that window, so it was a different claimant (one that had passed the gap check but not yet parked) and the ordering assertion saw ['newer', 'replay'] (kirodotdev#13115). Wait for the park itself: poll the lease semaphore's waiter list, bounded, so the reset provably lands on a parked claimant, and keep the post-replay absence check generous (loop yields plus a short sleep) rather than tight. Closes kirodotdev#13115
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.
Problem / Motivation
test/test_cross_surface_stop_gate.py::TestStopTurnRecordsASessionScopedStop::test_a_woken_claimant_lands_behind_the_successorflakes on Windows shard 5 (#13115):assert order == ['replay']sees['newer', 'replay'].Why it matters
A PR that lands on that shard while the runner is slow goes red for a reason unrelated to its diff; on a fork PR every re-roll needs a maintainer to release the workflow hold again. #11827 hit it once today; the same shard was green on its three previous heads.
What changed
Symptom: the woken waiter appears to run ahead of the replay → root cause: the test's scenario is "a claimant ALREADY parked on the held lease when the reset lands", but it establishes that with
await asyncio.sleep(0.05); on a loaded Windows runner the waiter task has not reached the semaphore in 50 ms, so the reset lands on a claimant that has passed the gap check but not yet parked -- a different scenario whose outcome (newerfirst) is not what the test is pinning → change: a bounded_until_parked(mgr, key)helper polls the lease semaphore's waiter list and the reset is issued only once a claimant is provably parked; the post-replay absence check is kept generous (loop yields plus a short sleep) rather than tightened. Test-only; no production code touched.The un-parked claimant window (gap check passed, park not yet reached, reset lands) is a separate question about
get_or_createordering, noted on #13115 for the maintainers; this PR does not change the product and does not widen the test to that scenario.Backwards compatibility
Compatible: test-only change.
Tests
The changed test file (20 pass locally). The new precondition makes the intended scenario deterministic; the assertion still fails if the woken claimant does not queue behind the open gap.
Manual verification
N/A — unit coverage sufficient; the runner-timing dependence is removed by construction rather than by widening a sleep.
Screenshots / video
N/A — no UI change.
Closes #13115