mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-07-16 13:14:10 -04:00
Use DeleteDropWatch instead of Delete in test
Using the latter resulted in receiving extra OnDelete event callbacks. Using DeleteDropWatch removed the flake. Fixes #14138.
This commit is contained in:
parent
61e4eb4e1f
commit
fdd7322b38
1 changed files with 2 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ func ExampleInformer() {
|
|||
time.Millisecond*100,
|
||||
framework.ResourceEventHandlerFuncs{
|
||||
AddFunc: func(obj interface{}) {
|
||||
source.Delete(obj.(runtime.Object))
|
||||
source.DeleteDropWatch(obj.(runtime.Object))
|
||||
},
|
||||
DeleteFunc: func(obj interface{}) {
|
||||
key, err := framework.DeletionHandlingMetaNamespaceKeyFunc(obj)
|
||||
|
|
@ -327,7 +327,7 @@ func TestUpdate(t *testing.T) {
|
|||
if !allowedTransitions[pair{from, to}] {
|
||||
t.Errorf("observed transition %q -> %q for %v", from, to, n.Name)
|
||||
}
|
||||
source.Delete(n)
|
||||
source.DeleteDropWatch(n)
|
||||
},
|
||||
DeleteFunc: func(obj interface{}) {
|
||||
testDoneWG.Done()
|
||||
|
|
|
|||
Loading…
Reference in a new issue