Skip to content

Commit 01ff020

Browse files
Merge pull request #503 from camilamacedo86/cherry-flake-test
OCPBUGS-62811: for incompatible test add func to wait builder and deployer SA creation by OCP controller
2 parents 0df53a9 + 949740a commit 01ff020

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
@@ -185,7 +185,7 @@ func ExpectServiceAccountExists(ctx context.Context, name, namespace string) {
185185
Eventually(func(g Gomega) {
186186
err := k8sClient.Get(ctx, client.ObjectKey{Name: name, Namespace: namespace}, sa)
187187
g.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to get ServiceAccount %q/%q: %v", namespace, name, err))
188-
}).WithTimeout(10*time.Second).WithPolling(1*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name)
188+
}).WithTimeout(5*time.Minute).WithPolling(3*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name)
189189
}
190190

191191
// 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
@@ -73,6 +73,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1
7373
nsCleanup := createNamespace(nsName)
7474
DeferCleanup(nsCleanup)
7575

76+
// The builder (and deployer) service accounts are created by OpenShift itself which injects them in the NS.
77+
By(fmt.Sprintf("waiting for builder serviceaccount in %s", nsName))
78+
helpers.ExpectServiceAccountExists(ctx, "builder", nsName)
79+
80+
By(fmt.Sprintf("waiting for deployer serviceaccount in %s", nsName))
81+
helpers.ExpectServiceAccountExists(ctx, "deployer", nsName)
82+
7683
By("applying image-puller RoleBinding")
7784
rbCleanup := createImagePullerRoleBinding(rbName, nsName)
7885
DeferCleanup(rbCleanup)

0 commit comments

Comments
 (0)