Repository navigation
test(local-files): hold the main-context lock while a stamp test relies on the real clock - #2703
Merged
Merged
Conversation
…es on the real clock a_check_sees_a_change_the_attribute_cache_hides failed whenever a local_operations test moved the process-wide test clock beside it, because the simulated attribute cache then looked expired. Those tests only move the clock while they hold the shared main-context lock, so the stamp test now holds it for its whole run.
This was referenced Nov 24, 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.
Description
adapters::local_files::tests::stamps::a_check_sees_a_change_the_attribute_cache_hidesfailed whenever alocal_operationstest moved the process-wide test clock (TEST_NOW) beside it. The simulated NFS attribute cache dates its entries with that clock, so its 30 s entry looked expired and the "plain stat" returned fresh times.Every test that moves the clock already holds the shared main-context lock while it does (28 tests, all take it before setting the clock). The stamp test took that lock only inside its helpers, so it now holds it for its whole run. The helpers gained variants that take the held guard instead of locking again; nothing outside these two test files changes.
Here the issue's command failed 5 of 5 runs before the change and passed 8 of 8 after it. The issue was found on
h5-integration, where these two files are identical tomain.scripts/code-health.shwas not run (no CodeScene token).Visual evidence
N/A: test-only change.
How to test
./scripts/test-headless.py -- a_check_sees_a_change_the_attribute_cache_hides deletion::open_files file_copy.Expected result: Every run passes; before this change most runs failed with "a plain stat answers from the cache".
Related issue
Closes #2617