Dashboard E2E Flake (#578)

For a contributor whose dashboard-surface spec (tests/e2e/specs/dashboard.spec.ts, dashboard-supervisor, dashboard-analyst, dashboard-customize) times out under the battery: page.goto waits tens of seconds, then the same page renders sub-second on the next run. The harness retries nothing (testing.adoc#e2e-no-retries), so the run that surfaced it is the report — classify it with the table before touching anything.

Symptom → cause

Failure text What the captured artifact shows Cause

page.goto: Timeout … waiting until "load" (or networkidle)

The dashboard DOM already rendered; /livez answers 200 in milliseconds; the diff does not touch the render path

A test bug — the wrong Playwright lifecycle event. Every worker page opens a long-lived SSE EventSource (services/canopy-web/templates/base.html) plus deferred subresources, so load can hang long after the DOM is interactive. Fix the navigation (rules below).

page.goto times out even on domcontentloaded

A missing or partial DOM (a few of the 13 worker-dashboard panels); canopy-web logs show a truncated upstream fan-out with no handler completion

A server-side SSR stall: an upstream browned out and an un-budgeted SSR call held the document. Fixed by #1306 (aggregate request deadline, partials preserved); a recurrence is a fix: issue, never a test change.

toHaveCount mismatch ("Expected 12, Received 9") on a fully rendered but smaller DOM

The right panels, fewer of them

A leaked composition_documents row from another spec’s user_delta_v1 write. Fixed: dashboard-customize.spec.ts wipes in afterEach, and every e2e run TRUNCATEs composition_documents (reset_composition_documents in xtask/src/cmd/seed.rs, called from xtask/src/cmd/e2e.rs).

The two navigation rules

  1. Worker portal — navigate with gotoPortal(page, url) (tests/e2e/lib/helpers.ts), never bare page.goto. It waits for domcontentloaded; callers still assert on concrete panel locators, so a genuinely stalled render still fails. A spec file’s FIRST navigation carries FIRST_LOAD_NAV_TIMEOUT_MS (30 s, helpers.ts) because a cold browser context loads every static; later navigations keep the default budget.

  2. Applicant portal (Dioxus/WASM) — wait for hydration, not domcontentloaded. The portal stamps data-hydrated="1" on <html> after hydration (services/canopy-portal/src/interop.rs), and awaitHydrated(page) (tests/e2e/lib/portal.ts) gates the first wasm-handled interaction on it. The PUBLIC_PORTAL_PAGES audits in tests/e2e/specs/accessibility.spec.ts stay off gotoPortal for this reason. Never a click-retry loop.

Verify

Re-run the single spec against the running devstack and read the trace (testing.adoc#e2e-failure-artifacts): a wait-condition failure disappears once the navigation uses the right helper; a server-side stall or a count mismatch does not, and each becomes a fix: issue with the trace attached.

  • Stale JWKS recovery — a different flake with an overlapping empty-dashboard symptom, distinguished by the multi-service 401 cluster in the logs.

NOTE
History — the 2026-05-26 fsync diagnosis was withdrawn on 2026-06-06 (fast NVMe, no I/O stall); #1307 and #1410 moved every worker navigation to gotoPortal; #1284 added the hydration marker; #1306 (closed 2026-08-05) fixed the SSR fan-out. The full investigation is issue #578.
Edit this page · default