Altinity / Altinity/altinity-sql-browser
Parallel-worktree Playwright runs silently serve another worktree's source
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 8
- Forks
- 2
- Ø Merge
- 1 Std. 34 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
What
Parallel Playwright runs in different git worktrees of this repo silently serve each other's files, producing failures that have nothing to do with the branch under test.
playwright.config.js sets reuseExistingServer: !process.env.CI and the webServer binds a fixed default port. Every worktree uses the same config, so the second worktree to start a run finds the port already bound, skips launching its own build/e2e-serve.mjs, and attaches to the first worktree's server — which raw-serves that worktree's /src and tests/e2e. The specs then run against another branch's source with no warning.
How it showed up
During a multi-worktree /ship run (PRs #554–#558), three separate workers reported e2e failures in tests/e2e/tile-open-workbench.spec.js — one reported 4 failures, another 2, on branches that touch nothing related. One worker "confirmed" them as pre-existing by git stash-ing its own changes, which of course changed nothing, because its own files were never being served. CI was green on main and on all five branches the whole time.
Cost: a wrong conclusion that main had failing e2e specs, plus wasted diagnosis on all three workers.
Suggested fix
Make the harness worktree-safe rather than relying on discipline:
- derive the
webServerport per checkout (hash the repo root path, or read an env var the npm script sets) so concurrent worktrees cannot collide; and/or - set
reuseExistingServer: falseso a run always owns its own server; and/or - have
build/e2e-serve.mjsrefuse to be reused by a different checkout — e.g. serve a/__rootprobe returning its own absolute repo path, and let the config assert it matches before any spec runs. The assertion is the valuable part: it converts a silent wrong-source run into an immediate, legible failure.
A related smaller footgun in the same class: two vitest runs in one worktree clobber each other's coverage/.tmp and report phantom test failures with an unrelated ENOENT … coverage-*.json rejection. Worth at least a note in docs/DEVELOPMENT.md.
Why deferred
Test-infrastructure defect found while shipping unrelated bug/low issues; not in scope for any of them.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Untersuchung von playwright.config.js und build/e2e-serve.mjs und prüfe anschließend den für tests/e2e/tile-open-workbench.spec.js beschriebenen Fehler bei parallelen Worktrees. Stelle sicher, dass gleichzeitig verwendete Worktrees nicht unbemerkt den Server eines anderen Checkouts wiederverwenden und dass ein Mismatch eindeutig fehlschlägt, bevor die Specs ausgeführt werden. Erwäge, das zugehörige Vitest-Coverage-Problem in docs/DEVELOPMENT.md zu dokumentieren, falls es weiterhin im Umfang liegt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, javascript, playwright, typescript
- Bereich
- developer-experience, testing-qa, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100