From e99f5f89cdc0fbb440e5df578056753a38ef3449 Mon Sep 17 00:00:00 2001 From: Soule BA Date: Mon, 22 Jan 2024 22:42:57 +0100 Subject: [PATCH] attempt to fix flaky test Signed-off-by: Soule BA --- gitea/integration_repositories_user_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gitea/integration_repositories_user_test.go b/gitea/integration_repositories_user_test.go index 3c9d342..e70b83e 100644 --- a/gitea/integration_repositories_user_test.go +++ b/gitea/integration_repositories_user_test.go @@ -299,6 +299,15 @@ var _ = Describe("Gitea Provider", func() { Expect(pr.Get().WebURL).ToNot(BeEmpty()) Expect(pr.Get().Merged).To(BeFalse()) + Eventually(func() bool { + var err error + err = userRepo.PullRequests().Merge(ctx, pr.Get().Number, gitprovider.MergeMethodMerge, "merged") + if err == nil { + err = errors.New("pull request not merged") + } + return retryOp.IsRetryable(err, fmt.Sprintf("merge pull request, repository: %s", userRepo.Repository().GetRepository())) + }, retryOp.Timeout(), retryOp.Interval()).Should(BeTrue()) + err = userRepo.PullRequests().Merge(ctx, pr.Get().Number, gitprovider.MergeMethodMerge, "merged") Expect(err).ToNot(HaveOccurred())