Skip to content

Commit

Permalink
test,networksegmentation: Wait for CUDN object be gone
Browse files Browse the repository at this point in the history
On CUDN cleanup is inconsistent as we see some flaky tests due to CUDN
"already exist" errors, implying object are not actually deleted.

Wait for CUDN object be gone when deleted.

Signed-off-by: Or Mergi <ormergi@redhat.com>
  • Loading branch information
ormergi committed Nov 17, 2024
1 parent 49a887e commit e3b7172
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/extended/networking/network_segmentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
Expect(err).NotTo(HaveOccurred())
_, err = e2ekubectl.RunKubectl("", "delete", "clusteruserdefinednetwork", c.name)
Expect(err).NotTo(HaveOccurred())
Eventually(func() bool {
_, err := e2ekubectl.RunKubectl("", "get", "clusteruserdefinednetwork", c.name)
return kerrors.IsNotFound(err)
}, 1*time.Minute, 3*time.Second).Should(BeTrueBecause("ClusterUserDefinedNetwork %q should be gone", c.name))
})
Expect(waitForClusterUserDefinedNetworkReady(c.name, 5*time.Second)).To(Succeed())
return err
Expand Down Expand Up @@ -728,6 +732,10 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
DeferCleanup(func() error {
cleanup()
_, _ = e2ekubectl.RunKubectl("", "delete", clusterUserDefinedNetworkResource, testClusterUdnName)
Eventually(func() bool {
_, err := e2ekubectl.RunKubectl("", "get", clusterUserDefinedNetworkResource, testClusterUdnName)
return kerrors.IsNotFound(err)
}, 1*time.Minute, 3*time.Second).Should(BeTrueBecause("ClusterUserDefinedNetwork %q should be gone", testClusterUdnName))
return nil
})
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -942,6 +950,10 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
DeferCleanup(func() error {
cleanup()
_, _ = e2ekubectl.RunKubectl("", "delete", "clusteruserdefinednetwork", cudnName)
Eventually(func() bool {
_, err := e2ekubectl.RunKubectl("", "get", "clusteruserdefinednetwork", cudnName)
return kerrors.IsNotFound(err)
}, 1*time.Minute, 3*time.Second).Should(BeTrueBecause("ClusterUserDefinedNetwork %q should be gone", cudnName))
return nil
})

Expand Down

0 comments on commit e3b7172

Please sign in to comment.