Repository navigation
fix(ci): test-shards 探测不再因 SIGPIPE 跳过 node 分片 - #240
Merged
Merged
Conversation
pipefail 下 find | grep -q . 在 GNU find 分多次写(约 4 KB 以上)时 返回 141,被当成「没有测试」,atlas/packages/node 从换基座起在 Linux CI 上从没跑过。改用 find -print -quit,不经管道。 加 --list(只列分片、不跑、不清 test-reports)和回归用例: 分片清单与独立计算的一致,超长清单的目录仍算分片。
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2bcb642fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
400 个文件约 64–70 KB,GNU find 偶尔能在 grep -q 退出前写完,旧写法 200 次里有 5 次通过。放大到 4000 个长文件名,远超管道缓冲加 grep 一次 读取,find 必然在 grep 退出后还要写;旧探测本机 20/20 失败。
This was referenced Oct 18, 2026
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.
问题
atlas/scripts/test-shards.sh在set -o pipefail下用find … -print | grep -q .判断目录里有没有测试。GNU find 的输出超过约 4 KB 时会分几次写;grep -q读到第一行就退出,find 下一次写收到 SIGPIPE,管道返回 141,脚本当成「没有测试」把整个分片跳过。atlas/packages/node的测试路径清单约 11 KB,每次都中:从 10-10 换基座起,Linux CI(和 sync-omp)一次都没跑过 node 的 195 个测试文件、约 2200 条用例(10-10、10-11、10-17、10-18 的 CI 日志里分片编号都从 negotiation 直接跳到 paths)。macOS 的 find 不触发,所以本机 verify 一直在跑 node。console 的清单 3.8 KB,再加几个测试文件也会被跳过。改动
[ -z "$(find … -print -quit)" ],不经管道。--list:只打印会跑的分片目录,不跑测试、不清test-reports/。atlas/scripts/__tests__/testShards.test.ts:分片清单与独立遍历算出的一致(必须含atlas/packages/node);测试清单远超一次管道写入的目录仍是分片;没有测试的目录(含只在 node_modules 里有)不是分片。预期影响
验证
--list输出 36 个分片含 node;license-headers OK。shard N: atlas/packages/node)。