Skip to content

Commit d63e98f

Browse files
committed
test: wait for initial GitRepo sync before checking webhook deployment
The webhook test was failing because it checked for the deployed pod immediately after creating the GitRepo, but with polling disabled (24h), the GitRepo never performed an initial sync. This caused the test to timeout waiting for a deployment that was never created. Added a wait for the GitRepo status to show a commit, ensuring the initial sync completes before checking for the deployed resources.
1 parent 54f2673 commit d63e98f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

e2e/single-cluster/gitrepo_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ var _ = Describe("Monitoring Git repos via HTTP for change", Label("infra-setup"
287287
})
288288

289289
It("updates the deployment", func() {
290+
By("waiting for the gitrepo to be ready")
291+
Eventually(func(g Gomega) {
292+
status := getGitRepoStatus(g, k, gitrepoName)
293+
g.Expect(status.Commit).ToNot(BeEmpty(), "GitRepo should have synced initially")
294+
}, testenv.MediumTimeout, testenv.ShortTimeout).Should(Succeed())
295+
290296
By("checking the pod exists")
291297
Eventually(func() string {
292298
out, _ := k.Namespace(targetNamespace).Get("pods")

0 commit comments

Comments
 (0)