@@ -271,8 +271,8 @@ func TestSharedInformerWatchDisruption(t *testing.T) {
271
271
// source simulates an apiserver object endpoint.
272
272
source := fcache .NewFakeControllerSource ()
273
273
274
- source .Add (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod1" , UID : "pod1" }})
275
- source .Add (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod2" , UID : "pod2" }})
274
+ source .Add (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod1" , UID : "pod1" , ResourceVersion : "1" }})
275
+ source .Add (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod2" , UID : "pod2" , ResourceVersion : "2" }})
276
276
277
277
// create the shared informer and resync every 1s
278
278
informer := NewSharedInformer (source , & v1.Pod {}, 1 * time .Second ).(* sharedIndexInformer )
@@ -301,8 +301,8 @@ func TestSharedInformerWatchDisruption(t *testing.T) {
301
301
}
302
302
303
303
// Add pod3, bump pod2 but don't broadcast it, so that the change will be seen only on relist
304
- source .AddDropWatch (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod3" , UID : "pod3" }})
305
- source .ModifyDropWatch (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod2" , UID : "pod2" }})
304
+ source .AddDropWatch (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod3" , UID : "pod3" , ResourceVersion : "3" }})
305
+ source .ModifyDropWatch (& v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "pod2" , UID : "pod2" , ResourceVersion : "4" }})
306
306
307
307
// Ensure that nobody saw any changes
308
308
for _ , listener := range listeners {
@@ -315,7 +315,7 @@ func TestSharedInformerWatchDisruption(t *testing.T) {
315
315
listener .receivedItemNames = []string {}
316
316
}
317
317
318
- listenerNoResync .expectedItemNames = sets .NewString ("pod1" , " pod2" , "pod3" )
318
+ listenerNoResync .expectedItemNames = sets .NewString ("pod2" , "pod3" )
319
319
listenerResync .expectedItemNames = sets .NewString ("pod1" , "pod2" , "pod3" )
320
320
321
321
// This calls shouldSync, which deletes noResync from the list of syncingListeners
0 commit comments