diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 00203f8cf0..23c8892b7c 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -2811,6 +2811,8 @@ func userCleanup(t *testing.T) { func invokeUserTestCode(t *testing.T, ctx context.Context, ns string, doRun func(context.Context, *gomega.WithT, string)) { defer func() { + // Check for error logs before deleting the test namespace + checkOperatorErrorLogs(t, ctx, ns) DumpNamespace(t, ctx, ns) // Also dump the operator namespace in case it's common DumpNamespace(t, ctx, "camel-k") @@ -2820,6 +2822,11 @@ func invokeUserTestCode(t *testing.T, ctx context.Context, ns string, doRun func doRun(ctx, g, ns) } +func checkOperatorErrorLogs(t *testing.T, ctx context.Context, ns string) { + g := gomega.NewWithT(t) + g.Expect(OperatorLogs(t, ctx, ns)()).ShouldNot(gomega.ContainSubstring(`"level":"error"`)) +} + func deleteKnativeBroker(t *testing.T, ctx context.Context, ns metav1.Object) { nsRef := corev1.Namespace{ TypeMeta: metav1.TypeMeta{