diff --git a/discovery/file/file_test.go b/discovery/file/file_test.go index c138fc8a9..731611832 100644 --- a/discovery/file/file_test.go +++ b/discovery/file/file_test.go @@ -193,9 +193,10 @@ func (t *testRunner) targets() []*targetgroup.Group { func (t *testRunner) requireUpdate(ref time.Time, expected []*targetgroup.Group) { t.Helper() + timeout := time.After(defaultWait) for { select { - case <-time.After(defaultWait): + case <-timeout: t.Fatalf("Expected update but got none") return case <-time.After(defaultWait / 10):