molecule-core/canvas/e2e
Hongming Wang 15b98c4916 fix(e2e-canvas): kill teardown race that poisons concurrent runs
Setup wrote .playwright-staging-state.json at the END (step 7), only
after org create + provision-wait + TLS + workspace create + workspace-
online all succeeded. If setup crashed at steps 1-6, the org existed in
CP but the state file did not, so Playwright's globalTeardown bailed
out ("nothing to tear down") and the workflow safety-net pattern-swept
every e2e-canvas-<today>-* org to compensate. That sweep deleted
concurrent runs' live tenants — including their CF DNS records —
causing victims' next fetch to die with `getaddrinfo ENOTFOUND`.

Race observed 2026-04-30 on PR #2264 staging→main: three real-test
runs killed each other mid-test, blocking 68 commits of staging→main
promotion.

Fix: write the state file as setup's first action, right after slug
generation, before any CP call. Now:

  - Crash before slug gen        → no state file, no orphan to clean
  - Crash during steps 1-6       → state file has slug; teardown deletes
                                   it (DELETE 404s if org never created)
  - Setup completes              → state file has full state; teardown
                                   deletes the slug

The workflow safety-net no longer pattern-sweeps; it reads the state
file and deletes only the recorded slug. Concurrent canvas-E2E runs no
longer poison each other.

Verified by:
  - tsc --noEmit on staging-setup.ts + staging-teardown.ts
  - YAML lint on e2e-staging-canvas.yml
  - Code review: state file write moved to line 113 (post-makeSlug,
    pre-CP) with the original line-249 write retained as a "promote
    to full state" overwrite at the end
2026-04-29 19:23:56 -07:00
..
chat-separation.spec.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
context-menu-delete.spec.ts feat(canvas/e2e): add Playwright test for context-menu → delete confirm flow (#1344) 2026-04-21 08:11:48 +00:00
filestab-smoke.spec.ts test(e2e): add Playwright smoke for FilesTab split 2026-04-13 18:14:54 -07:00
org-template-import.spec.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
staging-setup.ts fix(e2e-canvas): kill teardown race that poisons concurrent runs 2026-04-29 19:23:56 -07:00
staging-tabs.spec.ts fix(api): probe /cp/auth/me before redirecting on 401 2026-04-25 23:49:28 -07:00
staging-teardown.ts fix(e2e-canvas): kill teardown race that poisons concurrent runs 2026-04-29 19:23:56 -07:00