Skip to content

Commit

Permalink
fix: Async mode should not retry jobs (#952)
Browse files Browse the repository at this point in the history
* fix: Async mode should not retry jobs

* remove apitest pipeline check
  • Loading branch information
tianfeng92 authored Oct 3, 2024
1 parent 99983c5 commit ab7c1e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 54 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,31 +272,6 @@ jobs:
--timeout 10m \
-r us-west-1
apitest:
needs: build
runs-on: ubuntu-latest
# apitest is not publicly released so let's be a bit lax during pre-release
continue-on-error: true
env:
BUILD_ID: ${{ github.run_id }}
BUILD_ENV: GitHub Actions

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download saucectl Binary
uses: actions/download-artifact@v4
with:
name: saucectlbin

- name: Set permissions
run: chmod +x ./saucectl

- name: Saucectl RUN - Config Driven
run: |
./saucectl run -c .sauce/apitest.yml -r us-west-1
playwright-cucumberjs:
needs: build
runs-on: ubuntu-latest
Expand Down
26 changes: 0 additions & 26 deletions .sauce/apitest.yml

This file was deleted.

6 changes: 3 additions & 3 deletions internal/saucecloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ func shouldRetryJob(jobData job.Job, skipped bool) bool {
}

// shouldRetry determines whether a job should be retried.
func shouldRetry(opts job.StartOptions, jobData job.Job, skipped bool) bool {
return belowRetryLimit(opts) &&
func (r *CloudRunner) shouldRetry(opts job.StartOptions, jobData job.Job, skipped bool) bool {
return !r.Async && belowRetryLimit(opts) &&
(shouldRetryJob(jobData, skipped) || belowThreshold(opts))
}

Expand Down Expand Up @@ -353,7 +353,7 @@ func (r *CloudRunner) runJobs(jobOpts chan job.StartOptions, results chan<- resu
opts.CurrentPassCount++
}

if shouldRetry(opts, jobData, skipped) {
if r.shouldRetry(opts, jobData, skipped) {
go r.JobService.DownloadArtifact(jobData, false)
if !jobData.Passed {
log.Warn().Err(err).Msg("Suite errored.")
Expand Down

0 comments on commit ab7c1e5

Please sign in to comment.