mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
notifications: fix test race
This commit is contained in:
parent
f47b611557
commit
6e4569f916
1 changed files with 6 additions and 4 deletions
|
|
@ -133,11 +133,13 @@ func TestManager_ReservationNotification(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
}()
|
||||
|
||||
// Wait a bit to ensure manager is running and has subscribed
|
||||
// Wait a bit to ensure manager is running and has subscribed to the
|
||||
// server notifications stream.
|
||||
require.Eventually(t, func() bool {
|
||||
mgr.Lock()
|
||||
defer mgr.Unlock()
|
||||
return len(mgr.subscribers[NotificationTypeReservation]) > 0
|
||||
mockClient.Lock()
|
||||
defer mockClient.Unlock()
|
||||
|
||||
return mockClient.timesCalled > 0
|
||||
}, time.Second*5, 10*time.Millisecond)
|
||||
|
||||
mockClient.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue