Skip to content

Commit 2fb8851

Browse files
authored
fix TestInformerExistingPodAddErrorAnnotatesWithPartialStatusOnRetry (istio#57830)
The reconcile loop will constantly retry given an error. This can affect further tests since the reconcile event counter is a global. Allow the pod to be added to the mesh and no more update events occur.
1 parent 0e0dfd1 commit 2fb8851

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cni/pkg/nodeagent/informers_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestInformerExistingPodAddErrorAnnotatesWithPartialStatusOnRetry(t *testing
176176
client := kube.NewFakeClient(ns, pod)
177177
fs := &fakeServer{}
178178

179-
fs.On("AddPodToMesh",
179+
call := fs.On("AddPodToMesh",
180180
ctx,
181181
mock.IsType(pod),
182182
util.GetPodIPsIfPresent(pod),
@@ -201,6 +201,11 @@ func TestInformerExistingPodAddErrorAnnotatesWithPartialStatusOnRetry(t *testing
201201

202202
assertPodAnnotatedPending(t, client, pod)
203203

204+
// allow the call to succeed, this will stop further retry events from occurring
205+
call.Return(nil)
206+
// assert that the pod has been annotated before we proceed
207+
assertPodAnnotated(t, client, pod)
208+
204209
// Assert expected calls actually made
205210
fs.AssertExpectations(t)
206211
}

0 commit comments

Comments
 (0)