Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

jobs:
browser-tests:
timeout-minutes: 30
timeout-minutes: 120
runs-on: ubuntu-latest
# This Chrome nightly image can no longer install browsers in Github CI for
# lack of some system dependencies:
Expand All @@ -33,8 +33,6 @@ jobs:
# env:
# HOME: /root # Firefox complains otherwise
steps:
- name: Put unstable chrome where playwright would look for it
run: mv /opt/google/chrome /opt/google/chrome-unstable
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
Expand All @@ -50,9 +48,51 @@ jobs:
- name: Install browser test dependencies
working-directory: browser-test
run: npm ci --ignore-scripts
# Cache Playwright's browser binaries between runs. The cache key
# is keyed on `browser-test/package-lock.json`, which moves when
# the resolved `@playwright/test` version changes, so a Playwright
# version bump invalidates the cache on the commit that lands it.
#
# The install step below runs unconditionally rather than guarded
# by `cache-hit`: `--with-deps` also installs apt system packages,
# which the cache does not cover, and the browser-binary download
# itself is a no-op on cache hit. Keeping the step unconditional
# avoids a second always-run apt step and keeps the workflow
# readable.
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('browser-test/package-lock.json') }}
restore-keys: |
playwright-${{ runner.os }}-
# Wrap the install in a retry: the recurring failure mode is a
# timeout downloading Chromium from the Playwright CDN shortly
# after a Chromium version bump, before the CDN has seeded the
# new binary widely. Three attempts with a 30-minute per-attempt
# ceiling: the observed failure mode is an attempt still making
# progress (slow CDN download or apt step) when the prior
# 15-minute ceiling killed it mid-progress and the retry started
# from scratch. The bump to 30 minutes gives one attempt enough
# headroom to complete; the 3-attempt safety net is retained for
# genuine transient failures. Worst case 3 x 30 = 90 minutes fits
# inside the job's 120-minute `timeout-minutes`, leaving headroom
# for setup, build, and the tests themselves. The bumped ceiling
# is provisional: once a real install time is observed, both the
# per-attempt and outer ceilings should come back down.
- name: Install Playwright Browsers
working-directory: browser-test
run: npx playwright install --with-deps
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
env:
# Surface the hanging step in the install path. The Chrome-for-
# Testing migration in Playwright >= 1.50 introduced a silent
# post-download hang on this CI; pw:install logs the probe and
# extract steps so the next run shows where the time is going.
DEBUG: pw:install
with:
timeout_minutes: 30
max_attempts: 3
command: cd browser-test && npx playwright install --with-deps
- name: Run Playwright tests
working-directory: browser-test
run: npx playwright test
Expand Down
24 changes: 12 additions & 12 deletions browser-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion browser-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.49.1",
"@playwright/test": "1.58.2",
"@types/node": "^20.11.16"
},
"eslintConfig": {
Expand Down
Loading