Skip to content

Commit 5cd5953

Browse files
authored
Merge pull request #5057 from tssurya/eip-flake-ci-CM
Fix CM-EIP controller UT flake
2 parents 6a64865 + 8973f8e commit 5cd5953

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

go-controller/pkg/clustermanager/egressip_controller_test.go

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,39 @@ var _ = ginkgo.Describe("OVN cluster-manager EgressIP Operations", func() {
12561256
gomega.Expect(fakeClusterManagerOVN.eIPC.nodeAllocator.cache).To(gomega.HaveKey(node2.Name))
12571257

12581258
gomega.Eventually(getEgressIPStatusLen(egressIPName)).Should(gomega.Equal(0))
1259-
gomega.Eventually(fakeClusterManagerOVN.fakeRecorder.Events).Should(gomega.HaveLen(3))
1259+
// event1 triggered during node1 add for the existing EIP and event2 is triggered during node2 add for the existing EIP
1260+
/*I0212 20:22:37.636573 1837759 egressip_controller.go:723] Egress node: node1 about to be initialized
1261+
I0212 20:22:37.636670 1837759 obj_retry.go:512] Add event received for *factory.egressNode node2
1262+
I0212 20:22:37.636757 1837759 egressip_controller.go:723] Egress node: node2 about to be initialized
1263+
I0212 20:22:37.636855 1837759 egressip_controller.go:1173] Current assignments are: map[]
1264+
I0212 20:22:37.636865 1837759 egressip_controller.go:1175] Will attempt assignment for egress IP: 192.168.126.51
1265+
E0212 20:22:37.636909 1837759 egressip_controller.go:1190] Egress IP: 192.168.126.51 address is already assigned on an interface on node node2
1266+
I0212 20:22:37.636919 1837759 obj_retry.go:551] Creating *factory.egressNode node2 took: 217.968µs
1267+
I0212 20:22:37.638850 1837759 egressip_controller.go:1173] Current assignments are: map[]
1268+
I0212 20:22:37.639675 1837759 egressip_controller.go:1175] Will attempt assignment for egress IP: 192.168.126.51
1269+
E0212 20:22:37.639753 1837759 egressip_controller.go:1190] Egress IP: 192.168.126.51 address is already assigned on an interface on node node2
1270+
I0212 20:22:37.639776 1837759 obj_retry.go:551] Creating *factory.egressNode node1 took: 3.316342ms*/
1271+
1272+
// event3 trigged from syncEgressIPMarkAllocator called during WatchEgressIP starter syncFunc and
1273+
// event4 is triggered on the actual EIP add reconcile
1274+
/*I0212 20:22:37.639894 1837759 egressip_controller.go:1729] Patching status on EgressIP egressip: [{add /metadata/annotations map[k8s.ovn.org/egressip-mark:50000]}]
1275+
I0212 20:22:37.641594 1837759 obj_retry.go:512] Add event received for *v1.EgressIP egressip
1276+
I0212 20:22:37.641635 1837759 egressip_controller.go:1173] Current assignments are: map[]
1277+
I0212 20:22:37.641641 1837759 egressip_controller.go:1175] Will attempt assignment for egress IP: 192.168.126.51
1278+
E0212 20:22:37.641664 1837759 egressip_controller.go:1190] Egress IP: 192.168.126.51 address is already assigned on an interface on node node2
1279+
I0212 20:22:37.641670 1837759 obj_retry.go:551] Creating *v1.EgressIP egressip took: 53.241µs
1280+
I0212 20:22:37.643003 1837759 factory.go:1322] Added *v1.EgressIP event handler 2
1281+
I0212 20:22:37.643123 1837759 obj_retry.go:568] Update event received for resource *v1.EgressIP, old object is equal to new: false
1282+
I0212 20:22:37.643154 1837759 obj_retry.go:620] Update event received for *v1.EgressIP egressip
1283+
I0212 20:22:37.643187 1837759 egressip_controller.go:1173] Current assignments are: map[]
1284+
I0212 20:22:37.643205 1837759 egressip_controller.go:1175] Will attempt assignment for egress IP: 192.168.126.51
1285+
E0212 20:22:37.643254 1837759 egressip_controller.go:1190] Egress IP: 192.168.126.51 address is already assigned on an interface on node node2*/
1286+
gomega.Eventually(fakeClusterManagerOVN.fakeRecorder.Events).Should(gomega.HaveLen(4))
1287+
for i := 0; i < 4; i++ {
1288+
recordedEvent := <-fakeClusterManagerOVN.fakeRecorder.Events
1289+
gomega.Expect(recordedEvent).To(gomega.ContainSubstring(
1290+
"EgressIPConflict Egress IP egressip with IP 192.168.126.51 is conflicting with a host (node2) IP address and will not be assigned"))
1291+
}
12601292
return nil
12611293
}
12621294

0 commit comments

Comments
 (0)