Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of test: fix flakey broker notifier test. into release/1.5.x #17136

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion helper/broker/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 @@ -50,6 +50,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()
}