Skip to content

Commit f69276f

Browse files
Merge pull request #501 from camilamacedo86/flake-incompatible
OCPBUGS-62753: for incompatible test add func to wait SA creation
2 parents 9ff2816 + 3b10938 commit f69276f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

openshift/tests-extension/pkg/helpers/cluster_extension.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func ExpectServiceAccountExists(ctx context.Context, name, namespace string) {
214214
Eventually(func(g Gomega) {
215215
err := k8sClient.Get(ctx, client.ObjectKey{Name: name, Namespace: namespace}, sa)
216216
g.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to get ServiceAccount %q/%q: %v", namespace, name, err))
217-
}).WithTimeout(10*time.Second).WithPolling(1*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name)
217+
}).WithTimeout(5*time.Minute).WithPolling(3*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name)
218218
}
219219

220220
// ExpectClusterRoleBindingExists waits for a ClusterRoleBinding to be available and visible to the client.

openshift/tests-extension/test/olmv1-incompatible.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 operator installation
7979
nsCleanup := createNamespace(nsName)
8080
DeferCleanup(nsCleanup)
8181

82+
// The builder (and deployer) service accounts are created by OpenShift itself which injects them in the NS.
83+
By(fmt.Sprintf("waiting for builder serviceaccount in %s", nsName))
84+
helpers.ExpectServiceAccountExists(ctx, "builder", nsName)
85+
86+
By(fmt.Sprintf("waiting for deployer serviceaccount in %s", nsName))
87+
helpers.ExpectServiceAccountExists(ctx, "deployer", nsName)
88+
8289
By("applying image-puller RoleBinding")
8390
rbCleanup := createImagePullerRoleBinding(rbName, nsName)
8491
DeferCleanup(rbCleanup)

0 commit comments

Comments
 (0)