From d2d8e71ea05e24fb81208b6ee54d651e50ef05e6 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Wed, 19 Nov 2025 09:10:21 +0100 Subject: [PATCH] notifications: fix test race --- notifications/manager_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/notifications/manager_test.go b/notifications/manager_test.go index 19da9c16..e0d0e01d 100644 --- a/notifications/manager_test.go +++ b/notifications/manager_test.go @@ -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)