mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
clean up poller test to not make infinite log messages
This commit is contained in:
4
pkg/client/cache/poller_test.go
vendored
4
pkg/client/cache/poller_test.go
vendored
@@ -104,6 +104,8 @@ func TestPoller_sync(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPoller_Run(t *testing.T) {
|
func TestPoller_Run(t *testing.T) {
|
||||||
|
stopCh := make(chan struct{})
|
||||||
|
defer func() { stopCh <- struct{}{} }()
|
||||||
s := NewStore(testPairKeyFunc)
|
s := NewStore(testPairKeyFunc)
|
||||||
const count = 10
|
const count = 10
|
||||||
var called = 0
|
var called = 0
|
||||||
@@ -118,7 +120,7 @@ func TestPoller_Run(t *testing.T) {
|
|||||||
return testEnumerator{}, nil
|
return testEnumerator{}, nil
|
||||||
}
|
}
|
||||||
return nil, errors.New("transient error")
|
return nil, errors.New("transient error")
|
||||||
}, time.Millisecond, s).Run()
|
}, time.Millisecond, s).RunUntil(stopCh)
|
||||||
|
|
||||||
// The test here is that we get called at least count times.
|
// The test here is that we get called at least count times.
|
||||||
<-done
|
<-done
|
||||||
|
Reference in New Issue
Block a user