diff --git a/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go b/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go index 4f218d621a6..8adaa4b834e 100644 --- a/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go +++ b/staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go @@ -587,11 +587,12 @@ func TestRetryWatcherToFinishWithUnreadEvents(t *testing.T) { watcher.Stop() + maxTime := time.Second select { case <-watcher.Done(): break - case <-time.After(10 * time.Millisecond): - t.Error("Failed to close the watcher") + case <-time.After(maxTime): + t.Errorf("The watcher failed to be closed in %s", maxTime) } // RetryWatcher result channel should be closed