From 2b24b2b4c6b642fab05da3a53dad904005ffad7f Mon Sep 17 00:00:00 2001 From: changluyi <47097611+changluyi@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:41:40 +0800 Subject: [PATCH] fix mcast e2e error (#4503) Signed-off-by: clyi --- test/e2e/kube-ovn/subnet/subnet.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/test/e2e/kube-ovn/subnet/subnet.go b/test/e2e/kube-ovn/subnet/subnet.go index 4c16c98f6a1..49ad284cdaf 100644 --- a/test/e2e/kube-ovn/subnet/subnet.go +++ b/test/e2e/kube-ovn/subnet/subnet.go @@ -1180,9 +1180,14 @@ var _ = framework.Describe("[group:subnet]", func() { modifiedSubnet.Spec.EnableMulticastSnoop = true subnetClient.PatchSync(subnet, modifiedSubnet) - subnet = subnetClient.Get(subnetName) - framework.ExpectNotEmpty(subnet.Status.McastQuerierIP) - framework.ExpectNotEmpty(subnet.Status.McastQuerierMAC) + framework.WaitUntil(time.Second, 5*time.Second, func(_ context.Context) (bool, error) { + subnet = subnetClient.Get(subnetName) + + if subnet.Status.McastQuerierIP != "" && subnet.Status.McastQuerierMAC != "" { + return true, nil + } + return false, nil + }, fmt.Sprintf("subnet %s failed to acquire mcast ip and mac", subnet.Name)) ginkgo.By("Checking subnet multicast snoop disable " + subnetName) subnet = subnetClient.Get(subnetName) @@ -1190,9 +1195,13 @@ var _ = framework.Describe("[group:subnet]", func() { modifiedSubnet.Spec.EnableMulticastSnoop = false subnetClient.PatchSync(subnet, modifiedSubnet) - subnet = subnetClient.Get(subnetName) - framework.ExpectEmpty(subnet.Status.McastQuerierIP) - framework.ExpectEmpty(subnet.Status.McastQuerierMAC) + framework.WaitUntil(time.Second, 5*time.Second, func(_ context.Context) (bool, error) { + subnet = subnetClient.Get(subnetName) + if subnet.Status.McastQuerierIP == "" && subnet.Status.McastQuerierMAC == "" { + return true, nil + } + return false, nil + }, fmt.Sprintf("subnet %s failed to release mcast ip and mac", subnet.Name)) }) framework.ConformanceIt("should support subnet add nat outgoing policy rules", func() {