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 <deluan@navidrome.org>
This commit is contained in:
parent
ff583970f0
commit
c369224597
1 changed files with 1 additions and 0 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue