Skip to content

ci(test): 分片器补路径与去重用例,耗时表不再记 0,改正分片数与重试的过时说明 - #2463

Merged
deepcoldy merged 2 commits into
masterfrom
ci/shard-timings-nits
Oct 28, 2026
Merged

deepcoldy merged 2 commits into
masterfrom
ci/shard-timings-nits

Conversation

@deepcoldy

Copy link
Copy Markdown
Owner

#2452 评审里提出的非阻断项(首审 2 条、交叉复审 4 条),合入后一并收尾。

改了什么

  • 耗时表不再记出 0(scripts/update-shard-timings.mjs):耗时 < 5ms 的文件四舍五入成 0,而分片器把 0 当「未记录」、改按中位数估。写入时下限钳到 0.01s;提交的表里原有的 5 个 0 值条目同步改成 0.01。影响原本 < 0.2s,改的是语义上的不一致。
  • 补用例(test/duration-shards.test.ts):
  • 改正过时说明:
    • CONTRIBUTING.md 还写着「CI 分 3 片」;
    • scripts/run-unit-shard.mjs 与 ci.yml 里关于「teardown 偶发时整片重跑一次」的注释:分片均衡后每片在 vitest 里已花 10–12 分钟,整片重跑放不进 20 分钟时限,这个偶发如果再出现,重试会以 job 超时收场,而不是重跑转绿。结果与不重试相同(都是红),不算回归;注释如实写明这一点,并说明它需要根治而不是靠这层重试。行为没改。

影响面

只动测试、脚本注释、文档和耗时表里 5 个值;分片计划只在那 5 个文件的权重上有 0.0x 秒的差别。src/ 零改动。

验证

  • test/duration-shards.test.ts + ci-unit-shards + run-unit-shard + test-hygiene:vitest 43 例全绿;bun test 跑 duration-shards 14 例全绿。
  • 变异(逐个改、跑、还原)全部变红:
    • 分片器直接用绝对 moduleId 查表 → 新的路径用例红;
    • 去掉 planShards 的去重 → 重复路径用例红;
    • 写入时不钳下限 → 合并用例红(毫秒文件记成 0)。

🤖 Generated with Claude Code

@deepcoldy

Copy link
Copy Markdown
Owner Author

已合入 7a24559(squash,标题带 #2463、正文为空)。合前复核:审过的 head b489c73 未变;期间 master 只进了 #2461(只改 test/cli-voice-setup.test.ts),GitHub 判 MERGEABLE;落地树与「master 52004ac + 审过的 head」逐一相同。合码时首审这边几乎同时也发起了合并,GitHub 只落了一次,结果如上。
交叉复审的三条备注:整片重试在均衡后必然超时、每文件开销不钳下限这一点没有用例守着、round 的命名,都记在 #2464,待决定。

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.55.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