Skip to content

Commit

Permalink
test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents
Browse files Browse the repository at this point in the history
Signed-off-by: knight42 <anonymousknight96@gmail.com>
  • Loading branch information
knight42 committed Sep 5, 2020
1 parent 1f708f6 commit 1d92314
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions staging/src/k8s.io/client-go/tools/watch/retrywatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d92314

Please sign in to comment.