From a9226205918faf19f2ea78083a7768c688db93c7 Mon Sep 17 00:00:00 2001 From: knight42 Date: Sat, 5 Sep 2020 17:19:47 +0800 Subject: [PATCH] test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents Signed-off-by: knight42 Kubernetes-commit: 1d92314f262548b6b24e309943274e0d9d196a41 --- tools/watch/retrywatcher_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/watch/retrywatcher_test.go b/tools/watch/retrywatcher_test.go index 4f218d62..8adaa4b8 100644 --- a/tools/watch/retrywatcher_test.go +++ b/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