From 0dca84c6943a7737ea50b97e8ac5f1cfc7f0fc87 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 9 Nov 2025 12:19:28 -0500 Subject: [PATCH] test: fix flaky CacheWarmer deduplication test Fixed race condition in the 'deduplicates items in buffer' test where the background worker goroutine could process and clear the buffer before the test could verify its contents. Added fc.SetReady(false) to keep the cache unavailable during the test, ensuring buffered items remain in memory for verification. This matches the pattern already used in the 'adds multiple items to buffer' test. Signed-off-by: Deluan --- core/artwork/cache_warmer_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/artwork/cache_warmer_test.go b/core/artwork/cache_warmer_test.go index 4125d6de0..7ae3a16e0 100644 --- a/core/artwork/cache_warmer_test.go +++ b/core/artwork/cache_warmer_test.go @@ -90,6 +90,7 @@ var _ = Describe("CacheWarmer", func() { }) It("deduplicates items in buffer", func() { + fc.SetReady(false) // Make cache unavailable so items stay in buffer cw := NewCacheWarmer(aw, fc).(*cacheWarmer) cw.PreCache(model.MustParseArtworkID("al-1")) cw.PreCache(model.MustParseArtworkID("al-1"))