Repository navigation
test(runtime): Process Compose, wait, and library adversarial tests - #162
Merged
Merged
Conversation
yesme
enabled auto-merge (squash)
September 3, 2026 21:30
任务书三第 2–4 项:三平台 Process Compose 拉起/就绪/重启/关停与失败 用例,确认旧监督器已删;wait 四种返回、超时边界、读不到与不成立、 并发与转述对抗;JCS 官方向量、写入中备份一致、锁在进程被杀后释放。
yesme
force-pushed
the
grok/r3-runtime-tests
branch
from
September 3, 2026 21:44
d8d8a9f to
c27b6b5
Compare
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.
定位与重述
这是四轴评审任务书三针对 Codex PR 乙(#159)的测试 PR,位置在 P1 运行时供应链与第一方机械工具层。要解决的问题:#159 已经用 Process Compose、
hctl2-tool wait和五处库替换了手写机制,但失败用例、三平台合同、四种 wait 返回、转述对抗、写入中备份和进程被杀后的锁释放还不在 CI 的 PR 路径上。本 PR 把这些对抗样本做成ci:fast测试,使 Linux x86_64 / macOS arm64 / macOS x86_64 的 Code 矩阵会跑到它们。完整五服务包测仍是packaging/dependencies:package-test(workflow_dispatch)。维持 / 修正 / 推翻写在 #159 评论,不另开文档。控制面尚未进树,所以「转述不能满足前置」在 wait 产出通道已堵住,派发拒绝仍只在约束层。
本地验收:
bash src/build/tests/check_process_compose_contract.sh通过cd src && ./buck2 test root//build/tests:process_compose_contract_test root//crates/hctl2-facts:unit_test root//crates/hctl2-foundation:unit_test root//apps/hctl2-tool:unit_test --target-platforms root//build/platforms:macos_arm64通过cargo test -p hctl2-facts -p hctl2-foundation -p hctl2-tool --offline通过当前生效约束集
docs/research/:本 PR 不引入新依赖。JCS / 文件锁 / Online Backup 的库选择已在研究文件里,并与 runtime: adopt Process Compose and add external fact waits #159 一致。业界方案调研
本 PR 新增一个测试驱动脚本
src/build/tests/check_process_compose_contract.sh。up/process restart/process stop/down(见docs/research/build-tools/process-compose.md发行侧用法)。测试用官方二进制和一份 POSIXsh夹具,覆盖拉起、就绪、重启、关停和 never-ready / crash / 未知进程 / 空实例 down;不自建 PID 监督器,也不把五服务真实拉起放进ci:fast(那是已有的包测)。fake-gh可执行文件走现有Command边界;文件事实用真实 SHA-256;进程事实用宿主ps。这与docs/research/sdk/github.md、docs/research/libs/notify.md的「工具箱读回、不经模型转述」一致。docs/research/libs/serde-jcs.md指向的官方 testdata;备份用 SQLite Online Backup API 在 WAL 写入中取快照(docs/research/libs/sqlite-online-backup.md);锁用标准库File::lock,并用另一进程flock后 SIGKILL 验证释放(docs/research/libs/fd-lock.md首选就是标准库,不是 fd-lock crate)。