Files
Nick Craig-Wood 9a0ec75359 cache: fix test flakiness by stopping the chunk cleaner promptly
The background chunk cleaner slept for the whole ChunkCleanInterval
(default 1 minute) before checking its stop channel, and only ran
CleanUpCache via the select default branch. This meant a cache that
had been stopped by StopBackgroundRunners could keep running
CleanUpCache for up to an interval afterwards.

The cache backend tests all share a single on-disk chunk store (the
TestInternalCache remote), so a lingering cleaner from a finished test
could call CleanChunksBySize and os.RemoveAll chunks that a later,
unrelated test had just written. The later test would then read a
chunk back and get an unexpected EOF - eg
TestInternalMaxChunkSizeRespected failing intermittently on CI.

Wait on a timer and the stop channel together so a stop is honoured
immediately and the cleaner can never run again once stopped.
2026-06-01 20:51:21 +01:00
..
2026-05-01 13:41:07 +01:00
2025-06-12 18:31:01 +01:00
2025-02-28 11:31:14 +00:00
2025-02-28 11:31:14 +00:00
2025-02-28 11:31:14 +00:00
2025-02-28 11:31:14 +00:00
2024-08-12 13:35:44 +01:00
2025-02-28 11:31:14 +00:00
2026-05-30 11:01:20 +01:00
2025-02-28 11:31:14 +00:00
2025-11-13 13:47:40 +00:00