Skip to content

Commit d601c85

Browse files
committed
Diagnose the failures some more
Signed-off-by: Oliver Gondža <ogondza@gmail.com>
1 parent 9c16257 commit d601c85

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

test/openshift/e2e/ginkgo/fixture/fixture.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,15 @@ func EnsureSequentialCleanSlateWithError() error {
194194
// Otherwise, expected error if it doesn't exist.
195195
}
196196

197-
// Finally, wait for default openshift-gitops instance to be ready
198-
failures := InterceptGomegaFailures(func() { // so we can run diagnostics
199-
Eventually(defaultOpenShiftGitOpsArgoCD, "5m", "5s").Should(argocd.BeAvailable())
200-
})
201-
if len(failures) > 0 {
202-
OutputDebugOnFail(defaultOpenShiftGitOpsArgoCD.Namespace)
203-
204-
Fail(strings.Join(failures, "\n"))
205-
}
206197

198+
// Finally, wait for default openshift-gitops instance to be ready.
199+
// Replace the fail handler for the time we fait for the ArgoCD instance to be ready, so that we can output debug information on failure.
200+
RegisterFailHandler(func(message string, callerSkip ...int) {
201+
OutputDebugOnFail(defaultOpenShiftGitOpsArgoCD.Namespace)
202+
Fail(message, callerSkip...)
203+
})
204+
Eventually(defaultOpenShiftGitOpsArgoCD, "5m", "5s").Should(argocd.BeAvailable())
205+
RegisterFailHandler(Fail) // Reset handler back
207206
return nil
208207
}
209208

0 commit comments

Comments
 (0)