notifications: fix test race

This commit is contained in:
Slyghtning 2025-11-19 09:10:21 +01:00
parent b74dab8af4
commit d2d8e71ea0
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -142,9 +142,11 @@ func TestManager_ReservationNotification(t *testing.T) {
return mockClient.timesCalled > 0
}, time.Second*5, 10*time.Millisecond)
mockClient.Lock()
require.Equal(t, 1, mockClient.timesCalled)
mockClient.Unlock()
require.Eventually(t, func() bool {
mockClient.Lock()
defer mockClient.Unlock()
return mockClient.timesCalled == 1
}, time.Second*5, 10*time.Millisecond)
// Send a test notification
testNotif := getTestNotification(testReservationId)