Skip to content

Commit 65c77b7

Browse files
authored
Merge pull request kubernetes#127492 from p0lyn0mial/upstream-deflake-consistent-read-fallback
pkg/storage/cacher/cacher_whitebox_test: deflake TestConsistentReadFallback when ResilientWatchCacheInitialization is off
2 parents ffabcdc + 077c35e commit 65c77b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ apiserver_watch_cache_consistent_read_total{fallback="true", resource="pods", su
381381
t.Fatalf("Couldn't create cacher: %v", err)
382382
}
383383
defer cacher.Stop()
384+
if !utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
385+
if err := cacher.ready.wait(context.Background()); err != nil {
386+
t.Fatalf("unexpected error waiting for the cache to be ready")
387+
}
388+
}
384389

385390
if fmt.Sprintf("%d", cacher.watchCache.resourceVersion) != tc.watchCacheRV {
386391
t.Fatalf("Expected watch cache RV to equal watchCacheRV, got: %d, want: %s", cacher.watchCache.resourceVersion, tc.watchCacheRV)

0 commit comments

Comments
 (0)