diff --git a/test/e2e/csv_e2e_test.go b/test/e2e/csv_e2e_test.go index 86680af7dfe..0a6a8385052 100644 --- a/test/e2e/csv_e2e_test.go +++ b/test/e2e/csv_e2e_test.go @@ -1306,28 +1306,42 @@ var _ = Describe("ClusterServiceVersion", func() { Expect(err).ShouldNot(HaveOccurred(), "error getting expected APIService") // Should create Service - _, err = c.GetService(testNamespace, serviceName) - Expect(err).ShouldNot(HaveOccurred(), "error getting expected Service") + Eventually(func() error { + _, err := c.GetService(testNamespace, serviceName) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) // Should create certificate Secret secretName = fmt.Sprintf("%s-cert", serviceName) - _, err = c.GetSecret(testNamespace, secretName) - Expect(err).ShouldNot(HaveOccurred(), "error getting expected Secret") + Eventually(func() error { + _, err = c.GetSecret(testNamespace, secretName) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) // Should create a Role for the Secret _, err = c.GetRole(testNamespace, secretName) - Expect(err).ShouldNot(HaveOccurred(), "error getting expected Secret Role") + Eventually(func() error { + _, err = c.GetRole(testNamespace, secretName) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) // Should create a RoleBinding for the Secret - _, err = c.GetRoleBinding(testNamespace, secretName) - Expect(err).ShouldNot(HaveOccurred(), "error getting exptected Secret RoleBinding") + Eventually(func() error { + _, err = c.GetRoleBinding(testNamespace, secretName) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) // Should create a system:auth-delegator Cluster RoleBinding - _, err = c.GetClusterRoleBinding(fmt.Sprintf("%s-system:auth-delegator", serviceName)) - Expect(err).ShouldNot(HaveOccurred(), "error getting expected system:auth-delegator ClusterRoleBinding") + Eventually(func() error { + _, err = c.GetClusterRoleBinding(fmt.Sprintf("%s-system:auth-delegator", serviceName)) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) // Should create an extension-apiserver-authentication-reader RoleBinding in kube-system - _, err = c.GetRoleBinding("kube-system", fmt.Sprintf("%s-auth-reader", serviceName)) + Eventually(func() error { + _, err = c.GetRoleBinding("kube-system", fmt.Sprintf("%s-auth-reader", serviceName)) + return err + }, timeout, interval).ShouldNot(HaveOccurred()) Expect(err).ShouldNot(HaveOccurred(), "error getting expected extension-apiserver-authentication-reader RoleBinding") // Should eventually GC the CSV diff --git a/test/e2e/installplan_e2e_test.go b/test/e2e/installplan_e2e_test.go index 692ead6c6e4..9e2f3dfad68 100644 --- a/test/e2e/installplan_e2e_test.go +++ b/test/e2e/installplan_e2e_test.go @@ -222,11 +222,12 @@ var _ = Describe("Install Plan", func() { // Fetch installplan again to check for unnecessary control loops fetchedInstallPlan, err = fetchInstallPlan(GinkgoT(), crc, fetchedInstallPlan.GetName(), func(fip *operatorsv1alpha1.InstallPlan) bool { - compareResources(GinkgoT(), fetchedInstallPlan, fip) + // Don't compare object meta as labels can be applied by the operator controller. + compareResources(GinkgoT(), fetchedInstallPlan.Spec, fip.Spec) + compareResources(GinkgoT(), fetchedInstallPlan.Status, fip.Status) return true }) require.NoError(GinkgoT(), err) - require.Equal(GinkgoT(), len(expectedStepSources), len(fetchedInstallPlan.Status.Plan), "Number of resolved steps matches the number of expected steps") // Ensure resolved step resources originate from the correct catalog sources