Skip to content

🎧 Your Personal Streaming Service

fix(tests): fix race condition in CacheWarmer pre-cache size test

Deluanf7b60c79527f
diff --git a/core/artwork/cache_warmer_test.go b/core/artwork/cache_warmer_test.go
index 47e187f41..6ddda00d6 100644
--- a/core/artwork/cache_warmer_test.go
+++ b/core/artwork/cache_warmer_test.go
@@ -180,14 +180,9 @@ var _ = Describe("CacheWarmer", func() {
cw := NewCacheWarmer(aw, fc).(*cacheWarmer)
cw.PreCache(model.MustParseArtworkID("al-1"))
- Eventually(func() int {
- cw.mutex.Lock()
- defer cw.mutex.Unlock()
- return len(cw.buffer)
- }).Should(Equal(0))
-
- sizes := aw.getCachedSizes()
- Expect(sizes).To(ContainElements(consts.UICoverArtSize, consts.UIThumbnailSize))
+ Eventually(func() []int {
+ return aw.getCachedSizes()
+ }).Should(ContainElements(consts.UICoverArtSize, consts.UIThumbnailSize))
})
})
})