Repository navigation
test(server): wait for a rewrite's change time to move on coarse file clocks - #3240
Merged
Merged
Conversation
WSL2's kernel stamps files from a 250 Hz clock, so a same-size rewrite that puts the modification time back can keep the old change time too; the three tests that rely on it now rewrite until it moves.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Owner
Author
|
Merge note (merge pass) at head abb78ce:
|
devswha
added a commit
that referenced
this pull request
Nov 15, 2026
… release starts; a Copilot log cut back to its complete lines reads as truncated (#3808) ## What Three tests fail on Linux before 6.13 or under CPU load, both of which a 4-vCPU cloud runner has (needed before #3802's VM runners take Fast checks): - `server/copilot.test.ts` "keeps a logged binding when only the log's timestamps change" and `server/session-history.test.ts` "reads a WAL store immutable once more ... when its writer came and went during the read": a kernel without fine-grained file timestamps stamps every change within one tick (about 4 ms) with the same time, so the test's next change could land in the tick of the one before and look like no change to the code under test, which compares times and sizes. Each test now waits until the file clock has moved past the file's last change before making the change it expects to be seen (the same approach as #3240). Test-only. - `scripts/plugin.ts` (`ovis link` handing over to an updated release): it started the release first and listened for SIGTERM/SIGHUP only after, so a signal arriving in between ended `link` and left the release running without it; `scripts/plugin-link.test.ts` "passes a SIGTERM on to the copy of link the app updated to" hit that window under load. It now listens first and passes on a signal that came while the release was starting. ## Verified On a mesh VM (Linux 6.12.113, 4 vCPU, the CI runner image's toolchain), this commit: | Test | Before | After | |---|---|---| | copilot.test.ts | failed on every VM run | 10/10 pass | | session-history.test.ts | failed in about half the VM runs | 10/10 pass | | plugin-link.test.ts, beside four CPU-bound processes | 1 of 3 failed | 10/10 pass | --------- Co-authored-by: sisyphus-dev-ai <[email protected]>
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.
Summary
Three unit tests rewrite a file to the same size and modification time and expect the reader to notice from the change time alone. On a kernel whose file timestamps come from a coarse clock (WSL2's kernel is built with
CONFIG_HZ=250, so ctime moves in 4 ms steps), a rewrite within the same tick keeps the old ctime as well, so nothing tells the two versions apart and the tests fail:server/omp-btw.test.ts: ompBtwTopics > reads a topic again when its file is replaced, even at the same size and timeserver/claude-images.test.ts: a lookup that sees the file rewritten drops the boundary it kept, even when it serves nothingserver/claude-images.test.ts: rejects an image when the path's last check sees a same-size rewrite that put the modification time backA probe of 200 back-to-back rewrites kept the same ctime 138 times on the WSL2 kernel (6.6.87.2-microsoft-standard-WSL2) and 0 times on a
CONFIG_HZ=1000Linux host. Self-hosted runners that run in WSL2 share that kernel with their containers, so Fast checks went red there for this reason only (e.g. job 128222905726).Each test now repeats its rewrite until the file's change time has moved, as it has for any real later rewrite; the condition is awaited, not slept for. Test-only change, no product code touched.
Validation
bun test ./server/omp-btw.test.ts ./server/claude-images.test.ts: 3 fail).bun run check fastgreen (on the WSL2 host, at this head's content on origin/main 552f65a).