From 877d889ac2c78b1c8c94dc2839351aad4136f908 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Sat, 6 Mar 2021 18:16:42 -0500 Subject: [PATCH] Add test timeout to mutation detector test --- .../k8s.io/client-go/tools/cache/mutation_detector_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/client-go/tools/cache/mutation_detector_test.go b/staging/src/k8s.io/client-go/tools/cache/mutation_detector_test.go index 6d8f2c3c5e468..589b87a099e20 100644 --- a/staging/src/k8s.io/client-go/tools/cache/mutation_detector_test.go +++ b/staging/src/k8s.io/client-go/tools/cache/mutation_detector_test.go @@ -49,8 +49,9 @@ func TestMutationDetector(t *testing.T) { informer := NewSharedInformer(lw, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer) detector := &defaultCacheMutationDetector{ - name: "name", - period: 1 * time.Second, + name: "name", + period: 1 * time.Second, + retainDuration: 2 * time.Minute, failureFunc: func(message string) { mutationFound <- true }, @@ -72,6 +73,8 @@ func TestMutationDetector(t *testing.T) { select { case <-mutationFound: + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("failed waiting for mutating detector") } }