test(watch-tool): deflake TestRetryWatcherToFinishWithUnreadEvents

Signed-off-by: knight42 <anonymousknight96@gmail.com>
This commit is contained in:
knight42 2020-09-05 17:19:47 +08:00
parent 1f708f6e62
commit 1d92314f26
No known key found for this signature in database
GPG Key ID: 1040B69865E7D86C

View File

@ -587,11 +587,12 @@ func TestRetryWatcherToFinishWithUnreadEvents(t *testing.T) {
watcher.Stop() watcher.Stop()
maxTime := time.Second
select { select {
case <-watcher.Done(): case <-watcher.Done():
break break
case <-time.After(10 * time.Millisecond): case <-time.After(maxTime):
t.Error("Failed to close the watcher") t.Errorf("The watcher failed to be closed in %s", maxTime)
} }
// RetryWatcher result channel should be closed // RetryWatcher result channel should be closed