Repository navigation
ci: 拆成作业图并行、测试五组、防跳过自检、omp 套件去误触发并分片、sync-omp 补 bwrap - #244
Merged
Merged
Conversation
分片参数可以是目录或单个 *.test.ts(x);--exclude 从每个分片里去掉一棵子树, 被切到的分片按剩余文件名在同一个进程里跑。--group 给出 CI 的五组:node-host (node/test/host)、node-rest(node 去掉 test/host)、ops(demo/env、atlas/scripts)、 e2e(tests/integration、demo/lib)、packages(默认分片里其余各组没点名的,新包 自动落入)。--files 列出将要跑的测试文件,--list-groups 列出组名。无参数的 默认行为不变。用例逐文件核对五组拼起来恰好是默认分片、node 两组拼起来恰好是 node 包。
check-test-files-ran.ts 读各组上传的 JUnit 报告,把报告里的 file 集合和 git ls-files 里 atlas/、demo/ 下的 *.test.ts(x) 对比:没跑的、不是阡陌测试却 跑了的(例如子串过滤拉进 omp 测试)、在两个分片里各跑一次的,任一出现即红, 找不到报告也红。一个测试都不注册的文件 Bun 不写进报告,按没跑算。 用例用 Bun 自己的 JUnit 输出验证解析(含转义的测试名与诱饵 file=),并对 本仓库全部已跟踪测试文件走一遍命令行的通过与失败两条路。对上一次 Linux CI (run 39102013193)的 36 份报告:567 跟踪、567 跑过,缺 0、多 0、重 0。
根 package.json 是基座文件,也装着阡陌的脚本。以前加一条 atlas: 脚本就会让 CI 追加 21–26 分钟的 omp test:ts(例如 2f6b417 加 atlas:build:public)。 现在两侧去掉 atlas:、qianmo: 前缀条目与 qm、precheck、verify 后再比,相同 就不算基座改动;其他字段、其他脚本、键序、bun.lock 照旧算,任一侧缺失或 不是 JSON 对象也照旧算。
sync-omp 的候选验证跑 atlas:test,其中生成代码隔离用例要起 bwrap;Ubuntu 24.04 runner 用 AppArmor 限制非特权用户命名空间,bwrap 配不了回环口 (Failed RTM_NEWADDR),atlas/scripts 分片 8 条红,定时运行天天红。atlas.yml 早有这一步,sync-omp 漏了。 把这一步做成阡陌自有路径下的复合 action(atlas/scripts/ci/allow-bwrap), 不动 .github/actions/* 下 omp 的复合 action;sync-omp 装完 bubblewrap 后调用。
printf 单引号里的反引号是 issue 正文的 Markdown,不是命令替换;actionlint 转来的 SC2016 是 origin/main 上唯一一条 actionlint 告警。
一个串行作业拆成作业图: - static:lint、类型、cycles、identity-paths、license-headers、omp-pin、unused、 sbom、omp check:ts 与基座改动检测(输出 required)。不等原生插件。 - native:从缓存恢复或构建原生插件,上传为 artifact;生成的绑定与入库的不一致 时只提醒。 - test:test-shards.sh --group 五组矩阵(node-host、node-rest、ops 含 registry-ha、e2e、packages),fail-fast 关,每组上传自己的 JUnit。 - build-qm:编译与冒烟。 - omp-test:只在 required 时跑,按 omp 自己的 OMP_TEST_SHARD 把 test:ts 分 6 片, 覆盖与不分片相同,不改基座文件。 - ci:汇总,任何作业失败或被取消即失败,omp-test 只在 required=false 时可以 跳过;再用 check-test-files-ran.ts 核对每个已跟踪的阡陌测试文件恰好跑一次。 跑测试的作业都经阡陌自有的复合 action 放开 bubblewrap 的用户命名空间。 testShards.test.ts 新增一条:workflow 的矩阵与 test-shards.sh 的组名一致。
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. |
residentHotSwitch.integration 与 resident.integration 给 `qm resident` 子进程 手写环境,预加载设的 QIANMO_RUNTIME_AUTOINSTALL=0 带不过去;P36 缺省底层是 dsh,子进程于是在 CI 上真去 `npm install @deepseek-ai/dsh`。这次安装跑在 bun test 进程旁边几十秒,期间 Linux 上同进程的 spawnSync 子进程退出后迟迟 不被回收(runner 上看到 bun test 名下的僵尸),identityIsolation、 residentRootOverlap 的 9 条用例每次 10 s 超时。本机对照:不修时该文件拉起 npm 安装、90 s;修后 33 s、没有 npm 进程。
1.4.2 在 Linux 上,同一个 bun test 进程里先跑 residentModelCredential.isolated、 residentModelProbe、residentModelProbeGate、residentProviderSignal,再跑 residentRootOverlap 的一串 openssl spawnSync 之后,后面的 spawnSync 会卡住:子进程已 退出成僵尸、它的 pidfd 在 spawnSync 自己的 epoll 里可读,主线程却在用户态空转 (3 s 内零系统调用),直到 10 s 用例超时。node-rest 组因此每次红 7–9 条 (identityIsolation 7 条、residentRootOverlap 2 条)。macOS 不复现。 CI 上同一组 6 个文件实测:1.4.2 失败 8/9(含 strace 掩盖的 1 次通过), BUN_FEATURE_FLAG_FORCE_WAITER_THREAD=1 仍 3/3 失败,1.4.3 通过 3/3 (47 pass、25.6 s;1.4.2 失败时 96 s)。 生产代码里 host/certRequest、ca/openssl、desktopCdp、provenance 也走 spawnSync,舰队构建(fleet/linux-build.sh)按 .tool-versions 取 bun,下次部署一并换上。 章程 §8 工具链一格仍写 1.4.2,留待负责人下次修订。
1.4.3 修好了 node-rest 的 spawnSync 空转,但在 omp 基座测试上带来两条新红: packages/ai 的 TextJudge(YAML 输出不再带行尾空格)与 coding-agent 的 session-storage-fd-inheritance(对照描述符不再到达子进程)。升 Bun 要改基座测试, 留给下一次 omp 同步一起做;这里先用分片绕开 1.4.2 的缺陷。
Bun 1.4.2 在 Linux 上,同一个 bun test 进程先跑 residentModelCredential.isolated、 residentModelProbe、residentModelProbeGate、residentProviderSignal,再跑 residentRootOverlap 的一串 openssl spawnSync 后,之后的 spawnSync 收不回子进程: 子进程已是僵尸、pidfd 可读,主线程用户态空转到 10 s 超时(identityIsolation 7 条、 residentRootOverlap 2 条)。 test-shards.sh 新增 apart 列表:这四个文件从 atlas/packages/node 分片里拿出, 各自成一个分片(四个进程,各约 1 s 启动)。分组仍是每个文件恰好一次, testShards.test.ts 加一条钉住。Bun 过了 1.4.2 就删掉这段。
完整 node-rest 组 3 份里仍有 1 份卡死(这次连 provenance 的 git spawnSync 也中招), 说明 Bun 1.4.2 的 spawnSync 空转不只来自那四个文件。上游 oven-sh/bun#44581 写明了 原因:spawnSync 等待期间 GC 回收前面测试文件留下的 FilePoll,把 spawnSync 自己那个 循环的 num_polls 减歪,累积到抵消某次调用的 poll 后 tick 就不再 poll、空转到超时。 它随 GC 时机累积,分片绕不开,改为升 Bun(下一个提交)。
Bun 1.4.2 在 Linux 上,spawnSync 等待期间若 GC 回收了前面测试文件留下的 FilePoll, spawnSync 自己那个事件循环的 num_polls 会被减歪;累积到抵消某次调用的 poll 后,tick 不再 poll,主线程空转到超时,子进程成僵尸收不回(oven-sh/bun#34069,1.4.3 由 oven-sh/bun#44581 修复)。拆组后的 node-rest 因此每次红 7–9 条。CI 上同一组 6 个文件: 1.4.2 失败 8/9,1.4.3 通过 3/3。生产代码里 ca/openssl、host/certRequest 等处也走 spawnSync,舰队构建按 .tool-versions 取 bun,下次部署一起换上。 1.4.3 让两条 omp 基座测试变红,登记在 base-modifications.md §2.1: - packages/ai judgment.test.ts:YAML 不再带行尾空格,期望改成与上游 v18.12.1 一致。 - coding-agent session-storage-fd-inheritance.test.ts:对照描述符不再到达子进程, 对照断言只在它仍可继承(无 O_CLOEXEC)时检查,两条负向断言不变。 章程 §8 工具链一格仍写 1.4.2,留待负责人下次修订。
4 tasks done
sweetcornna
added a commit
that referenced
this pull request
Oct 18, 2026
#244 把原生插件拆成独立的 native 作业(按输入哈希缓存,产物作 omp-native 上传)。acceptance-local 照 test 作业的做法 needs: native 后下载它,删掉自己 那份缓存与构建步骤,系统包只剩 bubblewrap。仍只在 workflow_dispatch 时跑, 不进 ci 汇总;timeout-minutes 45 与依据不变,补记第一次 CI 实测。
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.
CI 提速第二批(第一批 #240 / #241 已合:node 分片补回、原生插件缓存、push 只跑 main)。分析与数据见
~/atlas-evidence/m1-work/2026-10-18/tidy/ANALYSIS.md。只改阡陌自有路径,不动基座文件(含.github/actions/*)。作业图
check:ts、基座改动检测(输出required)。omp-native给下游。生成绑定与入库不一致只给 warning。test-shards.sh --group五组,fail-fast: false:node-host(node/test/host)、node-rest(node 其余)、ops(demo/env、atlas/scripts、registry-ha)、e2e(tests/integration、demo/lib)、packages(其余,新包自动落入)。按上次 Linux CI 的 JUnit 各组 250–260 s。required == 'true',OMP_TEST_SHARD=i/6跑bun run test:ts(上游自带的轮转分片,覆盖与不分片相同,最慢一片约 299 s)。if: always()汇总;任何作业失败或取消即红,omp-test 仅在required=false时可跳过;下载各组报告做防跳过自检。以后设必需检查只设ci。其他改动
test-shards.sh:单文件分片、--exclude、--group、--files、--list-groups;无参行为不变,兼容 bash 3.2。atlas/scripts/check-test-files-ran.ts:各组 JUnit 里出现的文件对git ls-files的*.test.ts(x),没跑 / 多跑 / 重复任一即红。用上次 Linux CI 的 36 份报告实测 567/567、缺多重 0。check-omp-base-change.ts:根package.json只改atlas:/qianmo:脚本与qm、precheck、verify时不算基座改动(其他字段、其他脚本、键序、bun.lock照旧算),反向验证 7 条变红。atlas/scripts/ci/allow-bwrap放开 AppArmor 对 bubblewrap 的限制(它因缺这步每天红在atlas/scripts分片的RTM_NEWADDR);顺带给原有一条 SC2016 加 shellcheck 声明。CLAUDE.full.md§3、base-switch-omp.md§6。.tool-versions,CLAUDE.full.md、base-switch-omp.md跟着改;章程 §8 工具链一格仍写 1.4.2,留待负责人下次修订)。拆组后 node-rest 每次红 7–9 条(identityIsolation 7 条、residentRootOverlap 2 条,都是 10 s 超时),根因是 Bun 1.4.2 在 Linux 上的 spawnSync 缺陷(Bug: spawnSync never returns: child exit lost (child stays zombie), wait loop busy-spins at 100% CPU re-registering a finished pipe reader (macOS ARM64) oven-sh/bun#34069,1.4.3 由 spawnSync: stop pointing the VM at the loop it waits on oven-sh/bun#44581 修复)。spawnSync 等待期间 GC 回收了前面测试文件留下的 FilePoll,把 spawnSync 自己那个循环的num_polls减歪;累积到一定程度后 tick 不再 poll,主线程空转到超时,子进程成僵尸收不回。CI 实测:BUN_FEATURE_FLAG_FORCE_WAITER_THREAD=1失败 3/3;1.4.3 通过 3/3。ca/openssl、host/certRequest等处同样走 spawnSync;舰队构建按.tool-versions取 bun,下次部署一起换上。base-modifications.md§2.1:packages/ai/test/judgment.test.ts:YAML 不再带行尾空格,期望与上游 v18.12.1 一致。packages/coding-agent/test/session-storage-fd-inheritance.test.ts:对照描述符不再到达子进程,对照断言改成只在它仍可继承(无O_CLOEXEC)时检查,两条负向断言不变。为什么扩展点不够用:断言是测试字面量,测试本身就是要改的对象。QIANMO_RUNTIME_AUTOINSTALL: '0':它们不继承 preload,CI 上真去 npm 装了 dsh。验证
actionlint0;atlas:typecheck/atlas:lint:ci/atlas:check:license-headers/atlas:check:unused/ identity-paths 都是 0;atlas/scripts/__tests__/199 pass / 3 skip / 0 fail。--list默认 36 分片 568 文件;五组 73 + 122 + 63 + 42 + 268 = 568,去重 568,与git ls-files逐行一致。预计墙钟
首次运行要看
改了两条基座测试,本 PR 判为
required=true,PR 运行里已跑 omp 6 片(run 39125376599 全绿,总耗时 8.5 分)。看:native artifact 上传下载与绑定比对 warning、五组实际耗时、ci打印568 tracked, 568 ran … missing 0, unexpected 0, duplicated 0。sync-omp 的修复要合入后下一次定时运行验证。