From d98cc3c22ed05bd657119972a8274a430f31409b Mon Sep 17 00:00:00 2001 From: hc-github-team-nomad-core <82989552+hc-github-team-nomad-core@users.noreply.github.com> Date: Wed, 10 May 2023 07:40:52 -0500 Subject: [PATCH] backport of commit ccaedec0c8d6430a4af008457110219759cf6bc6 (#17136) This pull request was automerged via backport-assistant --- helper/broker/notify_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helper/broker/notify_test.go b/helper/broker/notify_test.go index 51943987e3f..054b96733aa 100644 --- a/helper/broker/notify_test.go +++ b/helper/broker/notify_test.go @@ -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 @@ -50,6 +50,10 @@ func TestGenericNotifier(t *testing.T) { }(¬ifiedWG) } + // 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() }