mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: retry failed race tests in CI (#17846)
This PR enables retrying failed tests in the race suites unless a data race was detected. The goal is to reduce how often flakes disrupt developers' workflows. I bumped gotestsum to a revision from the `main` branch because it includes the `--rerun-fails-abort-on-data-race` flag which [I recently contributed](https://github.com/gotestyourself/gotestsum/pull/497). Incidentally, you can see it [in action in a CI job on this very PR](https://github.com/coder/coder/actions/runs/15040840724/job/42271999592?pr=17846#step:8:647).
This commit is contained in:
@@ -613,7 +613,7 @@ jobs:
|
||||
# c.f. discussion on https://github.com/coder/coder/pull/15106
|
||||
- name: Run Tests
|
||||
run: |
|
||||
gotestsum --junitfile="gotests.xml" -- -race -parallel 4 -p 4 ./...
|
||||
gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
|
||||
|
||||
- name: Upload Test Cache
|
||||
uses: ./.github/actions/test-cache/upload
|
||||
@@ -665,7 +665,7 @@ jobs:
|
||||
POSTGRES_VERSION: "16"
|
||||
run: |
|
||||
make test-postgres-docker
|
||||
DB=ci gotestsum --junitfile="gotests.xml" -- -race -parallel 4 -p 4 ./...
|
||||
DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
|
||||
|
||||
- name: Upload Test Cache
|
||||
uses: ./.github/actions/test-cache/upload
|
||||
|
||||
Reference in New Issue
Block a user