Merge pull request #99907 from liggitt/cache-test-timeout

Add test timeout to mutation detector test

Kubernetes-commit: dc493bb553c846719dff0075df174ecaa5d9f97b
This commit is contained in:
Kubernetes Publisher 2021-03-06 18:43:53 -08:00
commit b4932b529f

View File

@ -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")
}
}