Parallel-worktree Playwright runs silently serve another worktree's source
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- git, javascript, playwright, typescript
调研方向
先检查 playwright.config.js 和 build/e2e-serve.mjs,然后查看针对 tests/e2e/tile-open-workbench.spec.js 所描述的并行 worktree 失败问题。验证并发 worktree 不能静默复用另一个 checkout 的 server,并且 mismatch 会在 specs 运行前明确失败。如果相关 Vitest coverage 问题仍在范围内,请考虑在 docs/DEVELOPMENT.md 中记录该问题。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 8
- 派生
- 2
- 平均合并
- 1 小时 34 分钟
- 30 天内合并 PR
- 6
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Altinity/altinity-sql-browser 的其他 Issue
-
inbox
难度 2/5 1-3 小时 新手友好度 76/100
Altinity/altinity-sql-browser#605 ·
-
inbox
难度 2/5 1-3 小时 新手友好度 78/100
Altinity/altinity-sql-browser#509 ·
-
inbox
难度 2/5 1-3 小时 新手友好度 78/100
Altinity/altinity-sql-browser#489 ·
-
flamegraph 未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
Altinity/altinity-sql-browser#684 ·
-
bug
难度 4/5 3-5 天 新手友好度 68/100
Altinity/altinity-sql-browser#680 · 2 条评论 ·
查看 Altinity/altinity-sql-browser 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
area:tools bug good first issue help wanted priority:P2
难度 2/5 1-3 小时 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 条评论 ·