test(picker/summary): sleep between writes to avoid mtime tick collision#2433
Merged
test(picker/summary): sleep between writes to avoid mtime tick collision#2433
Conversation
Closes #2432 Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Apr 27, 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.
Problem
test_cache_roundtrip_and_prune_on_writeflaked on PR #2429'scode-coveragejob (logs) — the assertion thatdeadbeefwas pruned after writingcafebabefailed, then a rerun passed.Root cause:
sweep_lru(src/cache.rs:126) sorts entries by file mtime to pick the eviction victim. The test wrotedeadbeefandcafebabeback-to-back with no delay; on filesystems with coarse mtime resolution both files can share a tick, making eviction order nondeterministic and sometimes pruning the newer entry instead.Solution
Add a 10 ms sleep between the two writes — the same gap
test_sweep_lru_trims_oldest_entries(src/cache.rs:319-322) already uses for the same reason.Testing
Targeted test passes locally; the broader
commands::picker::summary::testsandcache::testsmodules still pass.Closes #2432 — automated triage