mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
test: remove racy buffer length assertion in scrobbler test
Removed the buffer.Length() check that was causing intermittent test failures. The background goroutine started by newBufferedScrobbler can process and dequeue scrobble entries before the test assertion runs, leading to a race condition where the observed length is 0 instead of 1. The Eventually block that follows already verifies the scrobble was processed correctly. Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
27e05aa239
commit
7e74d74c3a
@ -51,9 +51,10 @@ var _ = Describe("BufferedScrobbler", func() {
|
||||
Expect(scr.ScrobbleCalled.Load()).To(BeFalse())
|
||||
|
||||
Expect(bs.Scrobble(ctx, "user1", scrobble)).To(Succeed())
|
||||
Expect(buffer.Length()).To(Equal(int64(1)))
|
||||
|
||||
// Wait for the scrobble to be sent
|
||||
// Wait for the background goroutine to process the scrobble.
|
||||
// We don't check buffer.Length() here because the background goroutine
|
||||
// may dequeue the entry before we can observe it.
|
||||
Eventually(scr.ScrobbleCalled.Load).Should(BeTrue())
|
||||
|
||||
lastScrobble := scr.LastScrobble.Load()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user