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 e99f5f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gitea/integration_repositories_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit e99f5f8

Please sign in to comment.