test(cache): stop the relatime emulation from refreshing atimes for real - #266
Merged
Merged
Conversation
test_scanning_the_store_is_not_a_use_of_it failed intermittently on Linux (the orphan object was evicted along with the oldest generation). The _relatime helper stripped the native O_NOATIME flag before calling the real os.open, so the product's no-atime receipt read became an ordinary read on a real relatime mount (ext4, tmpfs): the kernel refreshed each receipt's 1972 atime to wall-clock time. Both generations then looked newer than the orphan, whose view receipt had been left at wall-clock time by the fixture, so the orphan went first -- whenever the scan landed in a later clock tick than the view write, and not otherwise. Pass the flag through where the platform has it, and pin the view receipt to the fixture's clock so any real refresh fails every run instead of racing the clock. Removing O_NOATIME from the product now fails the test deterministically.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
========================================
Coverage 65.3% 65.4%
========================================
Files 1452 1450 -2
Lines 127884 127495 -389
Branches 91821 91432 -389
========================================
- Hits 83564 83404 -160
+ Misses 39327 39156 -171
+ Partials 4993 4935 -58
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
test_scanning_the_store_is_not_a_use_of_it failed intermittently on Linux
(the orphan object was evicted along with the oldest generation). The
_relatime helper stripped the native O_NOATIME flag before calling the
real os.open, so the product's no-atime receipt read became an ordinary
read on a real relatime mount (ext4, tmpfs): the kernel refreshed each
receipt's 1972 atime to wall-clock time. Both generations then looked
newer than the orphan, whose view receipt had been left at wall-clock
time by the fixture, so the orphan went first -- whenever the scan landed
in a later clock tick than the view write, and not otherwise.
Pass the flag through where the platform has it, and pin the view
receipt to the fixture's clock so any real refresh fails every run
instead of racing the clock. Removing O_NOATIME from the product now
fails the test deterministically.
Intermittent CI failure seen on #263 (run 36326681628):
test_scanning_the_store_is_not_a_use_of_itevicted the orphan object. Root cause is the test's_relatimehelper stripping the real O_NOATIME, so the kernel refreshed receipt atimes to wall-clock time and the outcome depended on clock ticks. Before: 2/5 local failures. After: 200/200. Mutation check: removing O_NOATIME fromobjectunits._read_unusedfails the suite every run.🤖 Generated with Claude Code