From 7970ff827f71fec040fb4e48d6513bb0c53fdad9 Mon Sep 17 00:00:00 2001 From: Trey West Date: Mon, 30 Sep 2024 09:32:29 -0400 Subject: [PATCH] assisted ztp: use eventually in platform tests (#231) --- .../operator/tests/platform-selection-test.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/assisted/ztp/operator/tests/platform-selection-test.go b/tests/assisted/ztp/operator/tests/platform-selection-test.go index afaf66cf9..c71aeb5db 100644 --- a/tests/assisted/ztp/operator/tests/platform-selection-test.go +++ b/tests/assisted/ztp/operator/tests/platform-selection-test.go @@ -112,9 +112,21 @@ var _ = Describe( } else { Expect(err).ToNot(HaveOccurred(), "error creating agentclusterinstall") By("Waiting for condition to report expected failure message") - err = testAgentClusterInstall.WaitForConditionMessage(v1beta1.ClusterSpecSyncedCondition, - "The Spec could not be synced due to an input error: "+message, time.Second*10) - Expect(err).NotTo(HaveOccurred(), "got unexpected message from SpecSynced condition") + Eventually(func() (string, error) { + testAgentClusterInstall.Object, err = testAgentClusterInstall.Get() + if err != nil { + return "", err + } + + for _, condition := range testAgentClusterInstall.Object.Status.Conditions { + if condition.Type == v1beta1.ClusterSpecSyncedCondition { + return condition.Message, nil + } + } + + return "", nil + }).WithTimeout(time.Minute*2).Should(Equal("The Spec could not be synced due to an input error: "+message), + "got unexpected message from SpecSynced condition") } }, Entry("that is SNO with VSphere platform", v1beta1.VSpherePlatformType, true, 1, 0,