fix(web): stabilize flaky album/timeline/selection E2E specs #785
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/web-ci-stability"
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?
Follow-up to #784. Reproduced the new-base flakes locally and fixed the deterministic races rather than bumping timeouts. Final scope is test-only (4 spec files).
Root causes and fixes
albums.spec.ts:1308 (failed 3/3 in runs 2577+2578) — heavy test, not a layout bug
Passed 3/3 locally but ~10s locally and >30s on loaded CI runners: 65 pattern albums × up to 6 rows, each row polled with two
boundingBox()round-trips (~200 polls). Replaced with a wait for all rows reportingdata-row-justified="true"plus one batched in-browser width comparison per pattern (~7s locally, ~10s CI), with a 60s budget surfacing regressions sooner.albums.spec.ts:1778 (mobile flaky in 2578; reproduced 3/12 locally) — test race, not app bug
Snapshot showed "6 selected" instead of 5: Playwright's coordinate click on "Select loaded" scrolls the review container to an edge, triggering the app's scroll-based lazy day reveal and growing the loaded window mid-test. The click is now dispatched on the already-enabled button, so no synthetic scroll can fire. 24/24 local repeats green.
timeline.spec.ts:302 (failed 3/3 in 2577; reproduced 2/8 locally) — CSS hover race
The section selection control is hover-revealed; a coordinate click after hover can land after a section re-render drops the hover state. Controls are now hover-revealed (asserted visible) and clicked via dispatch, with a re-hover before the final visibility assertion. 12/12 local repeats green.
discovery-domain-selection.spec.ts:129 (timed out at 180s in runs 2577+2578) — test cost
505 sequential coordinate clicks each scrolled and re-rendered the 505-card grid (~60s locally, >180s on CI). Controls are now toggled in-page via their real click handlers (cap logic unchanged) and the budget tightened 180s -> 60s. Runtime 1.0m -> 1.1s locally, ~3s in CI.
processing-issues.spec.ts:54 (flaky in 2578, not reproducible locally 12/12) — env timing
A single menu-toggle click can be lost while the page settles; the menu is now re-opened until its items render, bounded by
expect.poll(15s, 250ms interval). No sleeps.CI infrastructure (superseded)
An earlier revision of this branch also isolated the Playwright preview port, after run 2580 failed 433 tests with
net::ERR_CONNECTION_REFUSED(concurrent web-test containers share the host network on the shared runner). Main now carries the equivalent fix for this (3f1a084b, PR #779), including the root cause thatCIis unset inside the Playwright image soreuseExistingServerwas active in CI. During the merge of main this branch dropped its own port change in favour of main's implementation; the PR diff is now test-only.Verification
npx playwright test tests/albums.spec.ts tests/timeline.spec.ts tests/discovery-domain-selection.spec.ts tests/processing-issues.spec.ts-> 102 tests, 0 failures (99 passed, 3 skipped)npm run check-> 0 errors (20 pre-existing warnings)