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) {