Merge pull request #123897 from p0lyn0mial/upstream-cacher-decrease-running-time-of-empty-watch-event-cache

apiserver/storage/cacher: decrease of running time of TestEmptyWatchEventCache
This commit is contained in:
Kubernetes Prow Robot 2024-03-13 03:55:54 -07:00 committed by GitHub
commit 881cc5bc96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -431,7 +431,14 @@ func TestEmptyWatchEventCache(t *testing.T) {
if e, a := tt.expectedEvent.Object, event.Object; !apiequality.Semantic.DeepDerivative(e, a) {
t.Errorf("Expected: %#v, got: %#v", e, a)
}
case <-time.After(3 * time.Second):
case <-time.After(1 * time.Second):
// the watch was established otherwise
// we would be blocking on cache.Watch(...)
// in addition to that, the tests are serial in nature,
// meaning that there is no other actor
// that could add items to the database,
// which could result in receiving new items.
// given that waiting 1s seems okay
if tt.expectedEvent != nil {
t.Errorf("Failed to get an event")
}