From 456a9faf13798c6ffd8f8bde10f8f8b6d735bbcf Mon Sep 17 00:00:00 2001 From: Jian Zhang Date: Tue, 23 Sep 2025 11:00:33 +0800 Subject: [PATCH] remove Expect --- test/e2e/operatorhub_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/e2e/operatorhub_test.go b/test/e2e/operatorhub_test.go index 90e95ce6a..08eb978b2 100644 --- a/test/e2e/operatorhub_test.go +++ b/test/e2e/operatorhub_test.go @@ -367,10 +367,12 @@ var _ = Describe("operatorhub", func() { By("checking the redhat-operators catalogsource has been re-created") Eventually(func() error { cs := &olmv1alpha1.CatalogSource{} - err := k8sClient.Get(ctx, disabledNN, cs) - Expect(err).ShouldNot(HaveOccurred()) - Expect(cs).NotTo(BeNil()) - Expect(cs.GetName()).To(Equal(disabledName)) + if err := k8sClient.Get(ctx, disabledNN, cs); err != nil { + return err + } + if cs.GetName() != disabledName { + return fmt.Errorf("expected name %s, got %s", disabledName, cs.GetName()) + } return nil }, defaultTimeout, 3).Should(BeNil()) })