diff --git a/orbit/pkg/update/notifications_test.go b/orbit/pkg/update/notifications_test.go index bcbb1c3815..2e5c4b12dd 100644 --- a/orbit/pkg/update/notifications_test.go +++ b/orbit/pkg/update/notifications_test.go @@ -315,16 +315,15 @@ func TestWindowsMDMEnrollmentPrevented(t *testing.T) { require.Equal(t, baseFetcher.cfg, cfg) } - started := make(chan struct{}) go func() { - close(started) - // the first call will block in enroll/unenroll func cfg, err := fetcher.GetConfig() assertResult(cfg, err) }() - <-started + // wait a little bit to ensure the first `fetcher.GetConfig` call runs first. + time.Sleep(100 * time.Millisecond) + // this call will happen while the first call is blocked in // enroll/unenrollfn, so it won't call the API (won't be able to lock the // mutex). However it will still complete successfully without being