Repository navigation
test(updates): make the atomic-save test prove its reader overlapped the writer - #107
Merged
Merged
Conversation
…the writer The test asserted the reader had read at least once after a fixed 40 saves. On a busy CI runner the reader thread had not run by the time the writer finished (PR #106, line 178), so the assertion failed, and a passing run could have proved nothing about atomicity. The writer now starts only after the reader has read the file, and keeps saving until the reader has seen it 200 times (60 s limit). A non-atomic save still turns it red. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
The test asserted the reader had read at least once after a fixed 40 saves. On a busy CI runner the reader thread had not run by the time the writer finished (it failed on #106, at line 178), so the assertion failed, and a passing run could have proved nothing about atomicity.
The writer now starts only after the reader has read the file, and keeps saving until the reader has seen it 200 times (60 s limit). A run that did not overlap fails with a clear message. A non-atomic save still turns the test red (checked by mutation). I could not reproduce the original failure locally, so the fix removes the dependence on thread timing instead of tuning it.
Test-only change. Suite: 1348 passed, 18 skipped.
🤖 Generated with Claude Code