Skip to content

test(picker/summary): sleep between writes to avoid mtime tick collision#2433

Merged
max-sixty merged 1 commit intomainfrom
fix/issue-2432
Apr 27, 2026
Merged

test(picker/summary): sleep between writes to avoid mtime tick collision#2433
max-sixty merged 1 commit intomainfrom
fix/issue-2432

Conversation

@worktrunk-bot
Copy link
Copy Markdown
Collaborator

Problem

test_cache_roundtrip_and_prune_on_write flaked on PR #2429's code-coverage job (logs) — the assertion that deadbeef was pruned after writing cafebabe failed, then a rerun passed.

Root cause: sweep_lru (src/cache.rs:126) sorts entries by file mtime to pick the eviction victim. The test wrote deadbeef and cafebabe back-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::tests and cache::tests modules still pass.


Closes #2432 — automated triage

Closes #2432

Co-Authored-By: Claude <noreply@anthropic.com>
@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Apr 27, 2026
@max-sixty max-sixty merged commit e4fa2d8 into main Apr 27, 2026
24 checks passed
@max-sixty max-sixty deleted the fix/issue-2432 branch April 27, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flake: test_cache_roundtrip_and_prune_on_write fails when writes share an mtime tick

2 participants