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

- Introduce safeClose() helper that ignores 'Target page, context or
  browser has been closed' errors. When Hostinger LiteSpeed aborts a
  connection (net::ERR_ABORTED), Playwright internally marks the context
  as closed; the previous bare context.close() threw from inside catch,
  propagating out and killing setup before remaining retries ran.
- MAX_ATTEMPTS 3 → 5 for more tolerance of burst throttle windows.
- Backoff changed from flat 15 s → exponential 5/10/20/40 s (75 s total).
- Worst-case timing: 5 × 90 s nav + 75 s backoff = ~525 s < 900 s job limit.
- Final-failure message explicitly names the LiteSpeed throttle hypothesis.
- Version bump 1.2.0 → 1.3.0.

Agent-Session: engineer-e2e-authfix-20260612
This commit is contained in:
peptiderepo
2026-06-12 14:59:43 +00:00
parent a05d90405d
commit bf36db5b01
3 changed files with 69 additions and 11 deletions

View File

@@ -2,6 +2,26 @@
All notable changes to the peptide-e2e smoke suite will be documented here.
## [1.3.0] - 2026-06-12
### Fixed
- **Auth setup survives `ERR_ABORTED` on wp-login.php** (`global.setup.ts`).
When Hostinger's LiteSpeed throttles a GitHub runner IP, `page.goto` can
throw `net::ERR_ABORTED` rather than a `TimeoutError`. Playwright marks the
browser context closed internally on abort, so the existing
`context.close()` call in the catch block threw
`"browserContext.close: Target page, context or browser has been closed"`,
which propagated out of catch and killed setup before the remaining retries
ran. Two production deploys were blocked by this flake on 2026-06-12.
Fix: introduced `safeClose()` helper that swallows the already-closed
error, so an aborted context never terminates the retry loop. Max attempts
raised from 3 → 5; backoff is now exponential (5 s / 10 s / 20 s / 40 s)
instead of a flat 15 s, giving the throttle window more time to clear.
Worst-case timing: 5 × 90 s navigation + 75 s backoff = ~525 s, well under
the 900 s (15 min) job timeout. Final-failure message explicitly names the
LiteSpeed throttle hypothesis so future CI logs self-diagnose.
## [1.2.0] - 2026-06-12
### Added