Skip to content

Commit

Permalink
test: fix flakey broker notifier test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell committed May 9, 2023
1 parent f12c957 commit ccaedec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helper/broker/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestGenericNotifier(t *testing.T) {
}
timeoutWG.Wait()

// Test that all subscribers recieve an update when a single notification
// Test that all subscribers receive an update when a single notification
// is sent.
var notifiedWG sync.WaitGroup

Expand All @@ -53,6 +53,10 @@ func TestGenericNotifier(t *testing.T) {
}(&notifiedWG)
}

// Ensure the routines have had time to start before sending the notify
// signal, otherwise the test is a flake.
time.Sleep(500 * time.Millisecond)

notifier.Notify("we got an update and not a timeout")
notifiedWG.Wait()
}

0 comments on commit ccaedec

Please sign in to comment.