MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-1565

E2E flake: a bulk shard's whole shell-flows suite reds when the Playwright webServer / inngest dev server fails to come up (sign-up 404 + inngest 404)

Done
Description

Type: bug · Parent: Epic 8 (test-suite stability — a green CI is a launch gate) · Surfaces: the Playwright E2E (bulk-*) CI job / the E2E harness startup · Reported by: Yue.

A DIFFERENT flake class from MOTIR-671 / MOTIR-672 (those were spec-side optimistic-UI races, fixed). This one is a harness-startup failure: when a bulk shard's Playwright webServer (and/or the inngest dev server) doesn't come up cleanly, the entire shell-flows.spec.ts suite reds at once — not a product regression. Because PR CI runs each branch MERGED with main, this reds any open PR's E2E job regardless of its diff, forcing blind re-runs (the same tax MOTIR-671 called out).

Observed (PR #1517, run 28643519527, shard Playwright E2E (bulk-4))

8 failed, all in tests/e2e/shell-flows.spec.ts + 1 flaky in saved-filters.spec.ts (passed on retry); 54 passed. Failing specs: mobile drawer (310), sign-out via palette (342), sign-out via user menu (362), empty-workspace CTA (376), re-login restores last project (401), brand-new account lands on first workspace (483), archived last-active recovery (515), org-switch swaps list (598).

Root-cause signature in the WebServer log (both attempts):

  • GET /sign-up 404 — the app server wasn't serving the sign-up route, so every spec that creates/switches accounts fails at setup.
  • Repeated PUT /api/inngest 404 throughout the run, plus {"level":"ERROR","msg":"error handling queue item","error":"invalid status code: 404","item_kind":"start"} — the inngest dev server / serve endpoint never came up in that shard.

So the suite ran against a half-started server (app routes and/or inngest not ready), and every account-dependent shell flow failed deterministically within that shard.

Not the PR's change (verified)

  • PR #1517 only touched getProjectRoadmap's off-level blocker readback (roadmap) — zero auth/shell/inngest surface.
  • Sibling PR #1520 (a roadmap change cut from the SAME main) passed bulk-4 including all shell-flows specs — so the suite is healthy on main; #1517 just drew a bad shard start. Re-running the failed jobs is the current unblock, which is exactly the manual toil this bug is about removing.

Matches the known harness-flake class (sandbox OOM killing the Playwright webServer; the inngest-cli cold-download / cold-start timeout) noted in prior E2E runs.

Acceptance criteria

  • The E2E harness fails fast with a clear error if the app server or the inngest dev server is not fully ready before the suite runs — never executes specs against a half-up server that 404s /sign-up or /api/inngest.
  • Add a readiness gate in the harness startup: poll an authoritative app route (e.g. the sign-in/sign-up page returns 200) AND the inngest serve endpoint is live, with a bounded retry/backoff, before the first spec — so a cold inngest start waits rather than 404-cascading the suite.
  • On a genuine startup failure, the shard fails its own setup step (not 8 red specs) so the cause is unambiguous and not mistaken for a product regression on the PR under test.
  • Verified over 5 consecutive full CI E2E runs with zero harness-startup flakes (re-run to prove, per the MOTIR-671 bar).
  • No weakening of the shell-flows coverage; this is harness/startup hardening only.

Context refs

  • playwright.config.ts (webServer config — command, port, reuseExistingServer, readiness url/timeout) + the E2E CI workflow (bulk shard matrix) — where the startup readiness gate lands.
  • tests/e2e/_helpers/* (the shared sign-in / inngest-stub / db-reset harness) + the inngest dev-server launch — the cold-start path that 404s.
  • tests/e2e/shell-flows.spec.ts — the suite that reds wholesale when startup is incomplete.
  • Failing run: https://github.com/moooon-B-V/motir-core/actions/runs/28643519527/job/84945074303
  • MOTIR-671 / MOTIR-672 — prior E2E-flake bugs (spec-side races); this is the harness-startup sibling.