test(web): faster, deterministic Playwright suite #904
Loading…
Reference in a new issue
No description provided.
Delete branch "perf/playwright-test-speedup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Speeds up the web test stage on PRs by removing the main sources of wasted test time — fixed sleeps, race-prone waits, and the two persistently-failing desktop specs that burned all 3 retry attempts in CI.
1. Fixed sleeps → deterministic waits (10 spec files, 28 occurrences)
thumbnail-retry-budget.spec.ts: 15s hard sleep replaced withpage.clockfast-forward + per-retry request waits → 15s → <1s per projectwaitForTimeoutcalls (150ms–600ms) replaced with auto-retryingexpect,expect.pollstability streaks, request counters, or rAF-based pacing2. Two CI timeout-flakes made deterministic
timeline.spec.ts:302(section-header select): waits for section tiles + stable layout before the group-hover dispatch; was hitting the 30s test timeout and passing only on retry (≈60s wasted)instance-remove-mode.spec.ts:131: deterministic post-gotorender waits before clicks; applied to all sibling tests in the describe3. Two persistent desktop failures fixed at the root
albums.spec.ts:1332(failed all 3 attempts in run 3041): root cause was previews mounting only after 65 parallel album-detail requests — now gated on the served-detail responses; layout sampled in one atomic snapshot (ResizeObserver-stable); matrix split into 4 retry-isolated batches (60s/65-patterns → 45s per ~16-pattern batch)embedding-map.spec.ts:396(repeatedly 19.5–25.9s + timeouts): clicks were silently swallowed during Leaflet zoom animations (anim class lives on.leaflet-map-pane, not.leaflet-container) — now waits for real idle state + marker re-render detach proof; mobile-only hover replaced withdispatchEvent('mouseenter')(same handler, no viewport constraint)Verification
--retries=0: 322 passed, 12 skipped (pre-existing), 0 failed, 0 flakynpx playwright test --list+ stricttscchecks cleanExpected CI effect
Shorter, more stable web stage: no more 3-attempt failures on albums/embedding-map, no more 30s-timeout-then-retry double runs, ~30s less pure sleeping per run (thumbnail-retry budget alone was 33s of sleep across projects).