diff --git a/openshift/tests-extension/pkg/helpers/cluster_extension.go b/openshift/tests-extension/pkg/helpers/cluster_extension.go index b2c5f743bc..8441c485ce 100644 --- a/openshift/tests-extension/pkg/helpers/cluster_extension.go +++ b/openshift/tests-extension/pkg/helpers/cluster_extension.go @@ -142,6 +142,8 @@ func NewClusterExtensionObject(pkg, version, ceName, saName, namespace string, o } // ExpectClusterExtensionToBeInstalled checks that the ClusterExtension has both Progressing=True and Installed=True. +// Uses InstallTimeout because the BoxcutterRuntime requires all availability probes to pass +// before marking the extension as installed. func ExpectClusterExtensionToBeInstalled(ctx context.Context, name string) { k8sClient := env.Get().K8sClient Eventually(func(g Gomega) { @@ -153,13 +155,30 @@ func ExpectClusterExtensionToBeInstalled(ctx context.Context, name string) { g.Expect(conditions).NotTo(BeEmpty(), fmt.Sprintf("ClusterExtension %q has empty status.conditions", name)) progressing := meta.FindStatusCondition(conditions, string(olmv1.TypeProgressing)) + installed := meta.FindStatusCondition(conditions, string(olmv1.TypeInstalled)) + + pStatus, pReason, pMsg := conditionSummary(progressing) + iStatus, iReason, iMsg := conditionSummary(installed) + fmt.Fprintf(GinkgoWriter, "CE %q: Progressing=%s/%s (%s), Installed=%s/%s (%s)\n", + name, pStatus, pReason, pMsg, iStatus, iReason, iMsg) + g.Expect(progressing).ToNot(BeNil(), "Progressing condition not found") g.Expect(progressing.Status).To(Equal(metav1.ConditionTrue), "Progressing should be True") - installed := meta.FindStatusCondition(conditions, string(olmv1.TypeInstalled)) g.Expect(installed).ToNot(BeNil(), "Installed condition not found") g.Expect(installed.Status).To(Equal(metav1.ConditionTrue), "Installed should be True") - }).WithTimeout(DefaultTimeout).WithPolling(DefaultPolling).Should(Succeed()) + }).WithTimeout(InstallTimeout).WithPolling(DefaultPolling).Should(Succeed()) +} + +func conditionSummary(cond *metav1.Condition) (string, string, string) { + if cond == nil { + return "", "", "" + } + msg := cond.Message + if len(msg) > 120 { + msg = msg[:120] + "..." + } + return string(cond.Status), cond.Reason, msg } // EnsureCleanupClusterExtension attempts to delete any ClusterExtension and a specified CRD diff --git a/openshift/tests-extension/pkg/helpers/defaults.go b/openshift/tests-extension/pkg/helpers/defaults.go index 6963499eff..32e36ceba2 100644 --- a/openshift/tests-extension/pkg/helpers/defaults.go +++ b/openshift/tests-extension/pkg/helpers/defaults.go @@ -14,6 +14,12 @@ const ( // DefaultTimeout is how long we wait before giving up on an Eventually check. DefaultTimeout = 5 * time.Minute + // InstallTimeout is how long we wait for an operator to be fully installed. + // With the BoxcutterRuntime, Installed=True is only set after all availability + // probes pass (Deployments available, CRDs established, etc.), which can take + // longer than DefaultTimeout on resource-constrained or non-standard clusters. + InstallTimeout = 10 * time.Minute + // DefaultPolling is how often we check again during an Eventually test. DefaultPolling = 3 * time.Second )