Skip to content

test(pm2): 移除冷启动真实 pm2 God 的大注册表用例 - #1875

Merged
deepcoldy merged 1 commit into
masterfrom
chore/remove-pm2-god-jlist-test
Oct 13, 2026
Merged

deepcoldy merged 1 commit into
masterfrom
chore/remove-pm2-god-jlist-test

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

改了什么

删除 test/pm2-readonly-jlist.test.ts(#1026 引入,79 行)。该用例真实冷启动一个 pm2 God 并连起 6 个进程造 >200KB 注册表,再 spawn 只读 jlist helper 校验不截断。

为什么

该用例在 GitHub CI 上确定性失败:warmup pm2 status(test 第 49 行)在 runner 上约 84ms 直接 exit 1。

  • node test (3/3) 分片与 bun-test 两条独立腿首跑均红;对失败作业 rerun 一次后两腿再次失败——非 flake。
  • 同轮其余 10403 个用例全部通过。
  • 本地无法复现:Linux root 与非 root(nobody + 最小 env + 可访问 cwd)、node 22 与 bun 1.4 双运行时下均通过。

仓库测试惯例本就不冷启动真实 pm2 God:legacy-pm2-reaper 使用 fake pm2(注释明确写着要避免真连上导致 daemonize 一个 God),desktop/desktop-pm2-apps 对同一 helper 用 mock spawn。本用例是全仓唯一真起 God 的例外。

它守护的 pm2-readonly-client.ts write-callback 修复属于 #956 已在 master 的遗留桌面 observer(该文件自述:Legacy desktop runtimes may still have PM2 on disk;现代插件服务已改用内置 supervisor,pm2 也不再是 package.json 直接依赖,遗留路径后续会删除)。

删除后覆盖是否有缺口

无:

  • helper 的编排/调用逻辑仍由 mock spawn 的 test/desktop/desktop-pm2-apps.test.ts 覆盖(CI 稳定绿);
  • 「大输出写完 stdout 再 exit」的通用刷新契约由 test/stdout-flush.test.ts(2 MiB 真实管道 + 300ms 背压)与 test/ask-cli.test.ts(50 万字符 comment 端到端)守住,两者均不依赖 pm2、CI 稳定绿。

纯测试删除,-79 单行净删,不动任何生产代码。

影响面

仅测试。可解除 #1026 合入后 master 主 CI 的持续红灯;#1873(relay mirror 大载荷回归)rebase 到本提交后即可干净通过。

验证

  • bunx vitest run --project unit test/stdout-flush.test.ts test/ask-cli.test.ts test/desktop/desktop-pm2-apps.test.ts:3 文件 29 通过;
  • 全仓 grep 确认无任何代码/配置引用被删测试文件;
  • 失败证据:PR test(cli): 补 relay 响应镜像大载荷回归覆盖 #1873 的 run 38398203633(首跑 + failed-jobs rerun,shard-3 与 bun-test 均红在该文件第 49 行)。

🤖 Generated with Claude Code

该用例(#1026 引入)在 CI runner 上冷启动真实 pm2 God 时,warmup
`pm2 status` 确定性地 exit 1:node vitest 分片与 bun-test 两条独立
腿首跑及一次 rerun 均复现,10403 个其它用例全过;本地(root/非 root、
node/bun)无法复现。

仓库测试惯例本就不冷启动真实 God:legacy-pm2-reaper 用 fake pm2、
desktop-pm2-apps 对同一 helper 用 mock spawn(注释明言要避免真
daemonize)。本用例是唯一例外,且它守护的 write-callback 修复属于
#956 已在 master 的遗留桌面 observer(现代插件服务已改用内置
supervisor,pm2 也不再是直接依赖,整条遗留路径后续会删除)。

删除后覆盖不缺口:
- helper 的编排逻辑仍由 mock spawn 的 desktop-pm2-apps 测试覆盖;
- 「大输出写完再 exit」的通用契约由 stdout-flush 的 2 MiB 真实管道
  回归与 ask 的 50 万字符端到端回归守住(两者 CI 稳定绿)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
@deepcoldy
deepcoldy merged commit dabb5d8 into master Oct 13, 2026
14 checks passed
@github-actions

Copy link
Copy Markdown

🚀 Released in v3.43.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant