Skip to content

Commit 0b445c8

Browse files
authored
ci: add back CI-level automatic retrying for failing int and e2e tests (#9652)
We should fix all the flaky tests in the future - in the meantime this PR will reduce collectively wasted engineer hours, as we now don't have to manually open the awkward GH actions UI and press the retry button - often multiple times for each PR. It may not be enough to simply retry the test:int / test:e2e commands to get the tests not to flake for the next run, but let's see how this goes
1 parent 73e0e25 commit 0b445c8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,17 @@ jobs:
274274
if: matrix.database == 'supabase'
275275

276276
- name: Integration Tests
277-
run: pnpm test:int
277+
uses: nick-fields/retry@v3
278278
env:
279279
NODE_OPTIONS: --max-old-space-size=8096
280280
PAYLOAD_DATABASE: ${{ matrix.database }}
281281
POSTGRES_URL: ${{ env.POSTGRES_URL }}
282+
with:
283+
retry_on: any
284+
max_attempts: 5
285+
timeout_minutes: 15
286+
command: pnpm test:int
287+
on_retry_command: pnpm clean:all && pnpm install
282288

283289
tests-e2e:
284290
runs-on: ubuntu-latest
@@ -374,7 +380,13 @@ jobs:
374380
run: pnpm exec playwright install-deps chromium
375381

376382
- name: E2E Tests
377-
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci ${{ matrix.suite }}
383+
uses: nick-fields/retry@v3
384+
with:
385+
retry_on: any
386+
max_attempts: 5
387+
timeout_minutes: 20
388+
command: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci ${{ matrix.suite }}
389+
on_retry_command: pnpm clean:all && pnpm install && pnpm build:all
378390
env:
379391
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
380392
NEXT_TELEMETRY_DISABLED: 1

0 commit comments

Comments
 (0)