From f2c34ef674243aa18a57a6b09b47aff1167e9971 Mon Sep 17 00:00:00 2001 From: HIHIA <283304489@qq.com> Date: Sun, 20 Nov 2022 13:24:25 +0800 Subject: [PATCH] wait for a moment before start to clean up yurt-e2e-test namespace Signed-off-by: HIHIA <283304489@qq.com> --- test/e2e/autonomy/autonomy_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/e2e/autonomy/autonomy_test.go b/test/e2e/autonomy/autonomy_test.go index d663f394ddc..b0878f33c9e 100644 --- a/test/e2e/autonomy/autonomy_test.go +++ b/test/e2e/autonomy/autonomy_test.go @@ -255,10 +255,14 @@ var _ = ginkgo.AfterSuite(func() { gomega.Expect(err).NotTo(gomega.HaveOccurred(), "fail to reconnect cloud node to kind bridge") klog.Infof("successfully reconnected cloud node") - ginkgo.By("delete namespace:" + YurtE2ENamespaceName) gomega.Eventually(func() error { - return ns.DeleteNameSpace(c, YurtE2ENamespaceName) - }).WithTimeout(10 * time.Second).WithPolling(1 * time.Second).Should(gomega.Succeed()) + _, err = c.Discovery().ServerVersion() + return err + }).WithTimeout(20 * time.Second).WithPolling(1 * time.Second).Should(gomega.Succeed()) + + ginkgo.By("delete namespace:" + YurtE2ENamespaceName) + err = ns.DeleteNameSpace(c, YurtE2ENamespaceName) + gomega.Expect(err).NotTo(gomega.HaveOccurred(), "fail to delete created namespaces") }) func TestEdgeAutonomy(t *testing.T) {