Repository navigation
ci(test): 摘掉单元测试分片的整片重试,失败就是失败 - #2477
Merged
Merged
Conversation
分片按耗时均衡后每片在 vitest 里已花 10–12 分钟,收尾偶发时的整片重跑放不进 20 分钟时限,只会以超时收场;偶发也应该暴露出来再根治,而不是靠重跑放行 (#2464)。删掉 scripts/run-unit-shard.mjs 及只测其重试判定的用例,CI 直接 跑 `bun run test -- --shard=i/4`。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 28, 2026 09:05
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 28, 2026
|
🚀 Released in v3.55.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2464,Closes #2465(同一主题的两张单)。维护者定选 A:摘掉单元测试分片的整片重试,失败就是失败。
为什么
scripts/run-unit-shard.mjs原本在「所有测试文件都已通过、vitest fork 池收尾时报Worker exited unexpectedly」时把整片重跑一次(ci(test): 单测按 3 路 shard 拆到独立 runner,build 只保留编译 #1288 引入,当时快片约 7 分钟)。timeout-minutes: 20,所以这次重试结构上不可能转绿,只会多占约 6 分钟 runner、把红推迟到超时。改了什么
scripts/run-unit-shard.mjs,以及只测它重试判定的test/run-unit-shard-retry.test.ts。去掉重试后,这个判定函数没有其他调用方,按「不为死代码写测试」一并删除。.github/workflows/ci.yml:分片步骤直接跑bun run test -- --shard=${{ matrix.shard }}/4,这正是原 wrapper 第一遍执行的命令;注释改成说明为什么不重跑。test/ci-unit-shards.test.ts:一致性断言改成钉住新的 run 行(分母仍须等于 matrix 的 N)。scripts/update-shard-timings.mjs一句提到 wrapper 的注释改为中性表述,相关用例标题同步;test/shard-timings.json去掉被删文件的条目。round同时管取整和钳下限,拆成roundHundredths与roundFileSeconds。影响面
src/零改动。build和汇总 jobtest;分片 job 名、matrix、timeout-minutes: 20、fail-fast: false都不变。验证
ci-unit-shards、duration-shards、test-hygiene、scripts-typecheck-coverage:vitest 全绿;bun test跑前两个 17 例全绿。(同时跑的npm-binary-distribution有 2 条红,在不含本改动的 master 树上同样红,属本机环境问题,CI 上是绿的。)--shard,ci-unit-shards都变红;把每文件开销也钳下限,新的开销用例变红。🤖 Generated with Claude Code