mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
test: fix test datarace within helper broker. (#19974)
This commit is contained in:
@@ -46,12 +46,12 @@ func TestGenericNotifier(t *testing.T) {
|
||||
var notifiedWG sync.WaitGroup
|
||||
|
||||
for i := 0; i < 6; i++ {
|
||||
go func(wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
notifiedWG.Add(1)
|
||||
go func() {
|
||||
defer notifiedWG.Done()
|
||||
msg := notifier.WaitForChange(3 * time.Second)
|
||||
require.Equal(t, "we got an update and not a timeout", msg)
|
||||
wg.Done()
|
||||
}(¬ifiedWG)
|
||||
}()
|
||||
}
|
||||
|
||||
// Ensure the routines have had time to start before sending the notify
|
||||
|
||||
Reference in New Issue
Block a user