mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
Two flakes in ImageDiskCacheReconcilerTest, both mine, both green locally and red on CI. aStartAfterTheIntervalIsDueAgain measured the interval from the clock it sampled, but isDue() compares against the marker's file system mtime. A file system that keeps mtime at whole-second resolution reads the marker back up to a second before the write that made it, so `now + interval - 1` was already past the interval and the pass ran when the test expected it skipped. Reproduced exactly by truncating the marker's mtime to its whole second: same result object CI reported, ceilingBytes and all. It now pins the recorded pass to a whole second and measures from that, so the boundary holds at any mtime resolution — and asserts the file system kept the value, so an environment that cannot would fail loudly instead of flaking. Renamed to theIntervalIsMeasuredFromTheRecordedPass, which is the property. aSecondStartWithinTheIntervalSkipsTheWalk asserted the directory's byte total was unchanged across the skipped call. Coil evicts asynchronously on its own scope and the drainer unlinks behind it, so the two measurements raced both: CI saw 24103 where the test had recorded 25127. What the test needs to rule out is a wipe, and clear() takes DiskCache.size to zero — so it asserts on that instead, which no amount of eviction churn can move. Verified by running the class ten times, and by running CI's own task list locally (both lintBenchmark variants and both unit-test variants — the pre-push hook covers only testPlayDebugUnitTest, which is how these reached CI). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RYCgbvhtBCBNVLMxSWoCJ