ci: harden Playwright smoke retry
Use the lockfile-installed CLI and retry only runner SIGSEGV failures. Avoid reinstalling dependencies through the same unreliable transport after a transient crash.
This commit is contained in:
@@ -192,7 +192,13 @@ jobs:
|
||||
|
||||
- name: Install browser smoke runtime
|
||||
working-directory: job-tracker-ui
|
||||
run: npx playwright install --with-deps chromium
|
||||
env:
|
||||
PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT: '120000'
|
||||
run: |
|
||||
# Invoke the lockfile-installed CLI directly. `npx` may create a second
|
||||
# temporary dependency tree when its cache is damaged, which made this
|
||||
# runner's intermittent truncated downloads substantially worse.
|
||||
node ./node_modules/@playwright/test/cli.js install --with-deps chromium
|
||||
|
||||
- name: Test browser smoke flows
|
||||
working-directory: job-tracker-ui
|
||||
@@ -200,22 +206,25 @@ jobs:
|
||||
# Exercise the deployable frontend and avoid Turbopack's persistence crashes on
|
||||
# this runner's slow Docker volume.
|
||||
PLAYWRIGHT_STATIC_EXPORT: 'true'
|
||||
# This self-hosted runner has twice corrupted Playwright's installed JS/browser
|
||||
# payload (invalid control bytes followed by SIGSEGV/139). Retry the complete
|
||||
# suite once from a verified, clean install. The retry is intentionally bounded;
|
||||
# a genuine or repeated browser-test failure still blocks deployment.
|
||||
# The runner occasionally terminates an otherwise healthy Node process with
|
||||
# SIGSEGV/139. Retry only that infrastructure signature. Do not reinstall npm
|
||||
# or browser payloads here: doing so used to redownload hundreds of megabytes
|
||||
# through the same unreliable transport and made a transient crash persistent.
|
||||
# Assertion/configuration failures remain terminal and always block deployment.
|
||||
run: |
|
||||
if npm run test:e2e; then
|
||||
set +e
|
||||
npm run test:e2e
|
||||
smoke_status=$?
|
||||
set -e
|
||||
|
||||
if [ "$smoke_status" -eq 0 ]; then
|
||||
exit 0
|
||||
else
|
||||
smoke_status=$?
|
||||
fi
|
||||
if [ "$smoke_status" -ne 139 ]; then
|
||||
exit "$smoke_status"
|
||||
fi
|
||||
|
||||
echo "Browser smoke failed ($smoke_status) — rebuilding the browser runtime and retrying once..."
|
||||
rm -rf node_modules
|
||||
recovery_cache="$(mktemp -d)"
|
||||
npm ci --no-audit --no-fund --cache "$recovery_cache"
|
||||
npx playwright install --with-deps --force chromium
|
||||
echo "Browser smoke process crashed with SIGSEGV — retrying the unchanged suite once..."
|
||||
npm run test:e2e
|
||||
|
||||
- name: Build frontend
|
||||
|
||||
Reference in New Issue
Block a user