Skip to content

Commit e9cd753

Browse files
author
Earl Warren
committed
Merge pull request '[v9.0/forgejo] fix(ci): synchronize updates the commit status asynchronously' (go-gitea#5926) from bp-v9.0/forgejo-983aed4 into v9.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5926 Reviewed-by: Earl Warren <[email protected]>
2 parents 0db515d + dac13b7 commit e9cd753

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/integration/actions_trigger_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ jobs:
328328
sha, err := baseGitRepo.GetRefCommitID(pr.GetGitRefName())
329329
require.NoError(t, err)
330330
// verify the commit status changes to CommitStatusSuccess when the job changes to StatusSuccess
331-
assert.True(t, checkCommitStatus(sha, context, api.CommitStatusPending))
331+
require.Eventually(t, func() bool {
332+
return checkCommitStatus(sha, context, api.CommitStatusPending)
333+
}, 30*time.Second, 1*time.Second)
332334
for _, actionRun := range actionRuns {
333335
// verify the expected ActionRunJob was created and is StatusWaiting
334336
job := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunJob{RunID: actionRun.ID, CommitSHA: sha})
@@ -339,7 +341,9 @@ jobs:
339341
actions_service.CreateCommitStatus(db.DefaultContext, job)
340342
}
341343
// verify the commit status changed to CommitStatusSuccess because the job(s) changed to StatusSuccess
342-
assert.True(t, checkCommitStatus(sha, context, api.CommitStatusSuccess))
344+
require.Eventually(t, func() bool {
345+
return checkCommitStatus(sha, context, api.CommitStatusSuccess)
346+
}, 30*time.Second, 1*time.Second)
343347

344348
testCase.assert(t, sha, testCase.onType, testCase.action, actionRuns)
345349
})

0 commit comments

Comments
 (0)