From f7e5d4ede148cf1650fae78884d169c71fbe8682 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:21:10 -0500 Subject: [PATCH] Extend timeouts on flaky tests These tests are flaky on the minimum K8s version: - operator policy compliance check - alternative kubeconfig in hosted mode Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- test/e2e/case21_alternative_kubeconfig_test.go | 2 +- test/e2e/case38_install_operator_test.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/e2e/case21_alternative_kubeconfig_test.go b/test/e2e/case21_alternative_kubeconfig_test.go index 7ecd01f6..e3d09469 100644 --- a/test/e2e/case21_alternative_kubeconfig_test.go +++ b/test/e2e/case21_alternative_kubeconfig_test.go @@ -68,7 +68,7 @@ var _ = Describe("Test an alternative kubeconfig for policy evaluation", Ordered ) return utils.GetComplianceState(managedPlc) - }, defaultTimeoutSeconds, 1).Should(Equal("Compliant")) + }, defaultTimeoutSeconds*2, 1).Should(Equal("Compliant")) By("Verifying that the " + policyName + " was created using the alternative kubeconfig") _, err := targetK8sClient.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{}) diff --git a/test/e2e/case38_install_operator_test.go b/test/e2e/case38_install_operator_test.go index c3c057be..32f8351b 100644 --- a/test/e2e/case38_install_operator_test.go +++ b/test/e2e/case38_install_operator_test.go @@ -99,10 +99,12 @@ var _ = Describe("Test installing an operator from OperatorPolicy", Ordered, fun }) It("Should become Compliant", func() { - OpPlc := utils.GetWithTimeout(clientManagedDynamic, gvrOperatorPolicy, - case38OpPolicyDefaultOgName, case38OpPolicyDefaultOgNS, true, defaultTimeoutSeconds) + Eventually(func() interface{} { + OpPlc := utils.GetWithTimeout(clientManagedDynamic, gvrOperatorPolicy, + case38OpPolicyDefaultOgName, case38OpPolicyDefaultOgNS, true, defaultTimeoutSeconds) - Expect(utils.GetComplianceState(OpPlc)).To(Equal("Compliant")) + return utils.GetComplianceState(OpPlc) + }, defaultTimeoutSeconds, 1).Should(Equal("Compliant")) }) It("Should have installed the operator", func() {