Repository navigation
fix(repo): make ws re-harvest idempotence test clock-independent - #234
Merged
Merged
Conversation
…g to a second boundary (ref #223) The test needed two harvests to land in one unix_now() second and flaked under load. Add a test-only thread-local override of unix_now and pin it, so the re-minted candidate id is deterministic.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tonibergholm
approved these changes
Oct 20, 2026
tonibergholm
left a comment
Member
There was a problem hiding this comment.
Approved: test-only clock seam, loop-verified, CI green, Codex clean.
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 #223
The test relied on two harvests landing in the same
unix_now()second, aligning to a second boundary first. Under load the sequence could still cross a boundary.Adds a
#[cfg(test)]thread-local override (repo::TEST_NOW) read byunix_now(); the test pins it, so the re-minted candidate id matches deterministically. Production code is unchanged. The assertions are unchanged: re-harvest resolves to the existing landing tip, leaves no straywork-1branch, and ends the session.Verified: 200 runs of the test with two concurrent full-suite runs for load, 0 failures; clippy clean;
cargo test -p scl-repo -p scl-clipasses. No other test uses a second-boundary trick (grep unix_nowshows only this one).Summary by CodeRabbit