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()
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