From bab8023fff34a79bbf379b0cb5d9dce2370f9e2e Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 2 Oct 2025 14:54:20 +0300 Subject: [PATCH] fix Signed-off-by: Valeriy Khorunzhin --- tests/e2e/util_test.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/e2e/util_test.go b/tests/e2e/util_test.go index fa52dafc62..99688c16db 100644 --- a/tests/e2e/util_test.go +++ b/tests/e2e/util_test.go @@ -271,8 +271,21 @@ func ChmodFile(pathFile string, permission os.FileMode) error { func WaitVMAgentReady(opts kc.WaitOptions) { GinkgoHelper() - WaitPhaseByLabel(kc.ResourceVM, PhaseRunning, opts) - WaitConditionIsTrueByLabel(kc.ResourceVM, vmcondition.TypeAgentReady.String(), opts) + err := InterceptGomegaFailure(func() { + WaitPhaseByLabel(kc.ResourceVM, PhaseRunning, opts) + }) + if err != nil { + err = fmt.Errorf("Error while waiting for Virtual Machine Phase Running: %w", err) + } + Expect(err).NotTo(HaveOccurred()) + + err = InterceptGomegaFailure(func() { + WaitConditionIsTrueByLabel(kc.ResourceVM, vmcondition.TypeAgentReady.String(), opts) + }) + if err != nil { + err = fmt.Errorf("Error while waiting for Virtual Machine AgentReady condition: %w", err) + } + Expect(err).NotTo(HaveOccurred()) } func WaitConditionIsTrueByLabel(resource kc.Resource, conditionName string, opts kc.WaitOptions) {