Skip to content

Commit 5eb1a0d

Browse files
committed
wip
1 parent 5dc7dcb commit 5eb1a0d

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

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

+1-42
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func TestWatchNotHangingOnStartupFailure(t *testing.T) {
688688
// constantly failing lists to the underlying storage.
689689
dummyErr := fmt.Errorf("dummy")
690690
backingStorage := &dummyStorage{err: dummyErr}
691-
cacher, _, err := newTestCacherWithoutSyncing(backingStorage, testingclock.NewFakeClock(time.Now()))
691+
cacher, _, err := newTestCacherWithoutSyncing(backingStorage)
692692
if err != nil {
693693
t.Fatalf("Couldn't create cacher: %v", err)
694694
}
@@ -3087,44 +3087,3 @@ func TestListIndexer(t *testing.T) {
30873087
})
30883088
}
30893089
}
3090-
3091-
func TestRetryAfterForUnreadyCache(t *testing.T) {
3092-
if !utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) {
3093-
t.Skipf("the test requires %v to be enabled", features.ResilientWatchCacheInitialization)
3094-
}
3095-
backingStorage := &dummyStorage{}
3096-
clock := testingclock.NewFakeClock(time.Now())
3097-
cacher, _, err := newTestCacherWithoutSyncing(backingStorage, clock)
3098-
if err != nil {
3099-
t.Fatalf("Couldn't create cacher: %v", err)
3100-
}
3101-
defer cacher.Stop()
3102-
if err = cacher.ready.wait(context.Background()); err != nil {
3103-
t.Fatalf("Unexpected error waiting for the cache to be ready")
3104-
}
3105-
3106-
cacher.ready.set(false)
3107-
clock.Step(14 * time.Second)
3108-
3109-
opts := storage.ListOptions{
3110-
ResourceVersion: "0",
3111-
Predicate: storage.Everything,
3112-
}
3113-
result := &example.PodList{}
3114-
proxy := NewCacheProxy(cacher, backingStorage)
3115-
err = proxy.GetList(context.TODO(), "/pods/ns", opts, result)
3116-
3117-
if !apierrors.IsTooManyRequests(err) {
3118-
t.Fatalf("Unexpected GetList error: %v", err)
3119-
}
3120-
var statusError apierrors.APIStatus
3121-
if !errors.As(err, &statusError) {
3122-
t.Fatalf("Unexpected error: %v, expected apierrors.APIStatus", err)
3123-
}
3124-
if statusError.Status().Details == nil {
3125-
t.Fatalf("Expected to get status details, got none")
3126-
}
3127-
if statusError.Status().Details.RetryAfterSeconds != 2 {
3128-
t.Fatalf("Unexpected retry after: %v", statusError.Status().Details.RetryAfterSeconds)
3129-
}
3130-
}

0 commit comments

Comments
 (0)