test(web): isolate local Playwright preview port per worktree #915

Merged
chris merged 2 commits from fix/post-914-ci-failures into main 2026-09-27 16:14:59 +02:00
Owner

Summary

Found during the post-#914 investigation (which itself turned out clean: the alarming log was a 6-week-old daily run, not post-merge; #914's own CI/deploy is green).

  • Local cross-worktree port collision (ISSUE-077): non-container Playwright runs shared 127.0.0.1:4173 with reuseExistingServer, so concurrent agent worktrees could silently test a sibling's older build (proven: ADR 0099 sweep test failed 6/6 against a sibling's pre-#914 build, controlled repro included in KNOWN_ISSUES entry).
  • Fix: preview port derives from the isolation key — container hostname inside containers (unchanged), working directory outside — so every worktree gets its own port. PLAYWRIGHT_PREVIEW_PORT override kept.
  • No product/test behavior changes; CI is unaffected (container path identical).

Validation

  • npm run check: 0 errors; npm run build: success
  • Full suite: 641 passed / 0 failed (and isolated previously-failing specs with --retries=0: 58 passed)
  • ADR 0099 sweep stress (--workers=8 --repeat-each=3): 30/30
## Summary Found during the post-#914 investigation (which itself turned out clean: the alarming log was a 6-week-old daily run, not post-merge; #914's own CI/deploy is green). - **Local cross-worktree port collision (ISSUE-077)**: non-container Playwright runs shared 127.0.0.1:4173 with `reuseExistingServer`, so concurrent agent worktrees could silently test a sibling's older build (proven: ADR 0099 sweep test failed 6/6 against a sibling's pre-#914 build, controlled repro included in KNOWN_ISSUES entry). - Fix: preview port derives from the isolation key — container hostname inside containers (unchanged), working directory outside — so every worktree gets its own port. `PLAYWRIGHT_PREVIEW_PORT` override kept. - No product/test behavior changes; CI is unaffected (container path identical). ## Validation - `npm run check`: 0 errors; `npm run build`: success - Full suite: 641 passed / 0 failed (and isolated previously-failing specs with --retries=0: 58 passed) - ADR 0099 sweep stress (`--workers=8 --repeat-each=3`): 30/30
Concurrent agent worktrees all defaulted to 127.0.0.1:4173 with
reuseExistingServer enabled outside containers, so one worktree could
silently serve another worktree's (possibly older) build. Observed while
investigating post-merge failures: the ADR 0099 album-detail sweep test
failed 6/6 with a native link drag (pointercancel) because the sibling
worktree's pre-#914 app had no selectionSweep wiring, and accessibility
specs hit ERR_CONNECTION_REFUSED while that foreign server restarted.

Derive the default port from an isolation key instead: container
hostname inside Docker (unchanged), worktree cwd outside containers.
reuseExistingServer and the PLAYWRIGHT_PREVIEW_PORT override still work
per key.
docs(known-issues): record local cross-worktree preview-port collision (ISSUE-077)
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 6m4s
5742db9257
chris merged commit b88b114609 into main 2026-09-27 16:14:59 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!915
No description provided.