Skip to content

Commit

Permalink
attempt to fix flaky test
Browse files Browse the repository at this point in the history
Signed-off-by: Soule BA <[email protected]>
  • Loading branch information
souleb committed Jan 22, 2024
1 parent c39f2dd commit 1fef9e9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gitea/integration_repositories_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,17 @@ var _ = Describe("Gitea Provider", func() {
Expect(pr.Get().WebURL).ToNot(BeEmpty())
Expect(pr.Get().Merged).To(BeFalse())

err = userRepo.PullRequests().Merge(ctx, pr.Get().Number, gitprovider.MergeMethodMerge, "merged")
Eventually(func() bool {
var err error
getPR, err = userRepo.PullRequests().Get(ctx, pr.Get().Number)
pr := getPR.APIObject().(*gitea.PullRequest)
if err != nil || !pr.Mergeable {
err = errors.New("pull request not ready to merge")
}
return retryOp.IsRetryable(err, fmt.Sprintf("get pull request, repository: %s", userRepo.Repository().GetRepository()))
}, retryOp.Timeout(), retryOp.Interval()).Should(BeTrue())

err = userRepo.PullRequests().Merge(ctx, getPR.Get().Number, gitprovider.MergeMethodMerge, "merged")
Expect(err).ToNot(HaveOccurred())

getPR, err = userRepo.PullRequests().Get(ctx, pr.Get().Number)
Expand Down

0 comments on commit 1fef9e9

Please sign in to comment.