Files
civitai__civitai/playwright.preview.config.ts
Zachary Lowden 8942b54f8c test(preview): pre-warm all heavy pages + 2 retries (kill the slow-window flake) (#2483)
* test(preview): pre-warm all heavy pages + 2 retries (kill the slow-window flake)

The dominant smoke flake is a cold/slow-window page.goto timeout on a heavy SSR
page — the offender rotates (/, /models, /user/membership, /generate,
/purchase/buzz, /moderator/*) depending on which page the slow window hits.

Two-pronged:
 - Pre-warm EVERY heavy page the suite navigates in preview-auth.setup.ts (was
   only /, /models, /images). Each route JIT-compiles on first hit, so warming
   them up front (gold cookie for member pages, mod cookie for /moderator/*)
   removes the cold-start cost that caused most flakes. Sequential + best-effort
   (a slow warm GET still triggers the server-side compile).
 - retries 1 -> 2: a 2nd retry covers the residual mid-run slow window so it
   flakes-and-recovers instead of surfacing as a failure.

Pairs with the 60s->90s timeout raise (#2480). Together these target a
consistently-clean run — a prerequisite for eventually flipping smoke to gating.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(preview): raise setup timeout for cold-pod sequential warm-up (pr-review)

Addresses the pr-reviewer finding on this PR: the 8+ sequential warm-up GETs
(each 60s-capped) can, on a genuinely cold pod, cumulatively exceed the suite's
90s per-test timeout → the setup test times out → ALL dependent smoke tests are
SKIPPED (worse than the flake this PR fixes). The passing run only saw 1.7s
because the pod was already warm from verify-preview.

Fix: setup.setTimeout(480_000) — a ceiling for worst-case cold sequential
warm-up. Kept sequential (parallel heavy SSR renders OOM the single-replica pod,
per the config comment — the OOM is about concurrent renders, not specifically
playwright workers, so concurrent HTTP GETs are NOT a safe alternative here). The
ceiling doesn't slow the normal path: the setup still finishes as fast as the
warm-ups actually take.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 17:03:41 -05:00

3.4 KiB