Repository navigation
test(client): make the idle-lane surplus release test deterministic - #2241
Merged
Merged
Conversation
…ll-clock timing (#2240) The slow lane's finish now waits on a semaphore that the fast lane's second surplus release opens, so the ordering the test asserts no longer depends on CPU load. A lane that keeps its surplus workers fails the test through a 20s timeout instead of passing or hanging. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p is held The gate now opens a while after the second release, and the third release records whether the gate was already open. A driver that lets its last idle worker go while another lane still holds a gap fails the new kept-worker assertion; correct code cannot fail it under any load. Also asserts the fast lane never faults and the slow lane takes exactly one gap, and tightens the gate docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
yigitdot
enabled auto-merge (squash)
September 29, 2026 22:30
yigitdot
disabled auto-merge
September 29, 2026 22:31
alpergundogdu
approved these changes
Sep 30, 2026
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.
Closes #2240.
Problem
an_idle_lane_releases_its_surplus_workers_before_the_drive_endsneeded two release stamps to land at least 300ms before the drive ended, while the slow lane slept 600ms infinish. The store does its I/O onspawn_blocking, so under a full parallel run the fast lane took longer than that window. The slow lane then took another gap and started a new stall, and the releases landed less than 300ms before the end (early == 0). The driver's release logic is correct; only the test was racy.Fix
ScriptedSource::gated_finish(&'static Semaphore): eachfinishwaits for a permit after its range is delivered.Verification
cargo nextest run -p decdn-client --no-fail-fast: 8/8 full parallel runs green on macOS across both commits. Before the fix, 3/3 runs failed.live.load(..) > 1→> 0in the driver (the kept worker leaves too): the test fails 5/5 on the kept-worker assertion.> 1→> 99(surplus workers never leave): the test fails through the 20s timeout.cargo clippy --workspace --all-targets -- -D warnings,cargo fmt -- --check, andcargo doc -p decdn-clientwith-D warningsall pass.🤖 Generated with Claude Code