fix(auth): survive ERR_ABORTED in login retry — recreate context, 5 attempts with backoff #16

Merged
peptiderepo merged 1 commits from claude/e2e-auth-err-aborted-20260612 into main 2026-06-12 15:02:51 +00:00
peptiderepo commented 2026-06-12 15:00:09 +00:00 (Migrated from github.com)

What

Introduced safeClose() helper in global.setup.ts and raised login retries from 3 to 5 with exponential backoff (5 s / 10 s / 20 s / 40 s).

Why

Two production deploys were blocked on 2026-06-12 (workflow run 27423528491 and a follow-up run) by this sequence:

  1. page.goto("/wp-login.php") throws net::ERR_ABORTED — Hostinger LiteSpeed aborts the connection when it throttles GitHub runner IPs.
  2. Playwright internally marks the browser context as closed on ERR_ABORTED.
  3. The catch block attempted await context.close(), which threw "browserContext.close: Target page, context or browser has been closed".
  4. That secondary throw propagated out of the catch block, killing setup entirely — no remaining retries ran, no useful diagnostic appeared in logs.

The root cause is distinct from TimeoutError (which the original hardening handled): ERR_ABORTED does not just time out, it closes the context from Playwright's perspective before the application code can close it.

Changes

File Change
global.setup.ts safeClose() helper; MAX_ATTEMPTS 3→5; flat-15s backoff → exponential 5/10/20/40 s; final-failure message names LiteSpeed throttle hypothesis
CHANGELOG.md v1.3.0 entry
package.json version 1.2.0 → 1.3.0

Timing math (job timeout-minutes: 15 = 900 s)

5 attempts × 90 s NAV_TIMEOUT  = 450 s (navigation ceiling)
4 inter-attempt waits           =  75 s (5+10+20+40)
─────────────────────────────────────────
Worst-case total               ~525 s  ← 375 s headroom before job kills

Risk

Low. No test assertions changed, no spec files touched. The only behavioral change is that an already-closed context no longer aborts the retry loop. npx playwright test --list confirms 24 tests still enumerate identically (verified locally before push).

Test plan

  • npx playwright test --list → 24 tests, same set as main.
  • Next smoke run against staging will exercise the path; if LiteSpeed is still throttling on that run, the logs will now show all 5 attempts with backoff messages before failing, rather than dying silently on attempt 1.
## What Introduced `safeClose()` helper in `global.setup.ts` and raised login retries from 3 to 5 with exponential backoff (5 s / 10 s / 20 s / 40 s). ## Why Two production deploys were blocked on 2026-06-12 (workflow run 27423528491 and a follow-up run) by this sequence: 1. `page.goto("/wp-login.php")` throws `net::ERR_ABORTED` — Hostinger LiteSpeed aborts the connection when it throttles GitHub runner IPs. 2. Playwright internally marks the browser context as closed on `ERR_ABORTED`. 3. The catch block attempted `await context.close()`, which threw `"browserContext.close: Target page, context or browser has been closed"`. 4. That secondary throw propagated **out of the catch block**, killing setup entirely — no remaining retries ran, no useful diagnostic appeared in logs. The root cause is distinct from `TimeoutError` (which the original hardening handled): ERR_ABORTED does not just time out, it closes the context from Playwright's perspective before the application code can close it. ## Changes | File | Change | |------|--------| | `global.setup.ts` | `safeClose()` helper; MAX_ATTEMPTS 3→5; flat-15s backoff → exponential 5/10/20/40 s; final-failure message names LiteSpeed throttle hypothesis | | `CHANGELOG.md` | v1.3.0 entry | | `package.json` | version 1.2.0 → 1.3.0 | ## Timing math (job `timeout-minutes: 15` = 900 s) ``` 5 attempts × 90 s NAV_TIMEOUT = 450 s (navigation ceiling) 4 inter-attempt waits = 75 s (5+10+20+40) ───────────────────────────────────────── Worst-case total ~525 s ← 375 s headroom before job kills ``` ## Risk Low. No test assertions changed, no spec files touched. The only behavioral change is that an already-closed context no longer aborts the retry loop. `npx playwright test --list` confirms 24 tests still enumerate identically (verified locally before push). ## Test plan - `npx playwright test --list` → 24 tests, same set as main. - Next smoke run against staging will exercise the path; if LiteSpeed is still throttling on that run, the logs will now show all 5 attempts with backoff messages before failing, rather than dying silently on attempt 1.
Sign in to join this conversation.