Skip to content

Commit 788ac6e

Browse files
add polling so job fully deleted before proceed
1 parent 5d0731f commit 788ac6e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,15 @@ func verifyCatalogEndpoint(ctx SpecContext, catalog, endpoint, query string) {
105105
Expect(err).NotTo(HaveOccurred(), "failed to create Job")
106106

107107
DeferCleanup(func(ctx SpecContext) {
108+
By("Deleting Job and waiting for pods to terminate")
108109
_ = k8sClient.Delete(ctx, job)
110+
111+
// Wait for Job to be fully deleted.
112+
Eventually(func() bool {
113+
checkJob := &batchv1.Job{}
114+
err := k8sClient.Get(ctx, client.ObjectKeyFromObject(job), checkJob)
115+
return apierrors.IsNotFound(err)
116+
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(BeTrue())
109117
})
110118

111119
By("Waiting for Job to succeed")

0 commit comments

Comments
 (0)