mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-28 07:57:20 +00:00
Merge pull request #99907 from liggitt/cache-test-timeout
Add test timeout to mutation detector test Kubernetes-commit: dc493bb553c846719dff0075df174ecaa5d9f97b
This commit is contained in:
commit
b4932b529f
7
tools/cache/mutation_detector_test.go
vendored
7
tools/cache/mutation_detector_test.go
vendored
@ -49,8 +49,9 @@ func TestMutationDetector(t *testing.T) {
|
|||||||
|
|
||||||
informer := NewSharedInformer(lw, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer)
|
informer := NewSharedInformer(lw, &v1.Pod{}, 1*time.Second).(*sharedIndexInformer)
|
||||||
detector := &defaultCacheMutationDetector{
|
detector := &defaultCacheMutationDetector{
|
||||||
name: "name",
|
name: "name",
|
||||||
period: 1 * time.Second,
|
period: 1 * time.Second,
|
||||||
|
retainDuration: 2 * time.Minute,
|
||||||
failureFunc: func(message string) {
|
failureFunc: func(message string) {
|
||||||
mutationFound <- true
|
mutationFound <- true
|
||||||
},
|
},
|
||||||
@ -72,6 +73,8 @@ func TestMutationDetector(t *testing.T) {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-mutationFound:
|
case <-mutationFound:
|
||||||
|
case <-time.After(wait.ForeverTestTimeout):
|
||||||
|
t.Fatalf("failed waiting for mutating detector")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user