mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Merge pull request #117534 from Mskxn/fix_watcher
stop watcher when error occurs
This commit is contained in:
commit
041bb9a56c
@ -302,7 +302,7 @@ func TestInformerWatcherDeletedFinalStateUnknown(t *testing.T) {
|
|||||||
return retval, nil
|
return retval, nil
|
||||||
},
|
},
|
||||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||||
w := watch.NewFake()
|
w := watch.NewRaceFreeFake()
|
||||||
if options.ResourceVersion == "1" {
|
if options.ResourceVersion == "1" {
|
||||||
go func() {
|
go func() {
|
||||||
// Close with a "Gone" error when trying to start a watch from the first list
|
// Close with a "Gone" error when trying to start a watch from the first list
|
||||||
@ -315,6 +315,7 @@ func TestInformerWatcherDeletedFinalStateUnknown(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, _, w, done := NewIndexerInformerWatcher(lw, &corev1.Secret{})
|
_, _, w, done := NewIndexerInformerWatcher(lw, &corev1.Secret{})
|
||||||
|
defer w.Stop()
|
||||||
|
|
||||||
// Expect secret add
|
// Expect secret add
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user