fix(agc): 修 process_tree 夹具的硬编码测试路径(Linux lane 2/2 红,收敛引入)
Project CI / Backend tests (pull_request) Failing after 20s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m31s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m25s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m54s
Project CI / Repository checks (pull_request) Failing after 30s
Project CI / Frontend tests (pull_request) Successful in 3m34s
Project CI / AI game creator shell web tests (pull_request) Failing after 3m20s
Project CI / Native shell tests (pull_request) Successful in 9m8s

CI run 3708(head 694b54506)8 个 job:6 成功 / 2 失败。本提交修其中**我们引入**的那一条。

失败 1(我们引入 → 已修):AI game creator shell Rust lane 2/2 → shard 3/4 有 1 例失败
- 用例:agent::codex_provider::app_server::process_tree::tests::shutdown_stops_the_owned_background_writer_and_preserves_proof_scope
- 原始报错:`called Result::unwrap() on an Err value: Elapsed(())`;shard 内重跑该用例仍失败(非偶发)。
- 根因:process_tree.rs 的夹具用 `--exact` 复跑本测试二进制,路径是**硬编码**的
  `const FIXTURE = "agent::codex_app_server::process_tree::tests::owned_tree_process_fixture"`
  (process_tree.rs:307-308,master 原文;该文件本体与 master 逐字节相同)。codex provider 收敛把本模块
  挂到 `agent::codex_provider::app_server::` 下后,`--exact` 匹配 0 个用例 → 子进程不写 marker、
  不打印 TREE_READY → 父进程 `tokio::time::timeout(5s, …).unwrap()` 超时 → Elapsed(())。
- 修法(最小):该字符串同步为新模块路径,并补 2 行说明这个耦合。不改夹具逻辑、不删/不放宽用例、不用 #[allow]。
- 本地验证(Windows + 编辑器 feature):`cargo test -- process_tree::tests` → 3 passed / 0 failed;
  其中 `shutdown_proves_entire_owned_job_exit_and_keeps_sibling_running` 修复前 FAILED(同 Elapsed(()))、
  修复后 ok。cfg(unix) 的那条本机不编译,但走同一夹具常量,机制一致。
- 同类排查:全 crate 共 11 处「硬编码测试路径」字面量,逐条核对后**只有这一处**因本分支的模块搬迁失效
  (`direct_tools_mcp` / `builtin_plugins` / `command_exec` / `command_sandbox_trampoline` /
  `environment_check::web_creation::ownership` / `windows` 的路径本分支未改名,仍与真实模块一致)。

失败 2(上游自带 → 未修,只给证据):AI game creator shell web tests → `directThreadChat.test.ts`
- 失败用例 `DirectProject 聊天 reducer > 系统条目与未识别的 item 类型不进聊天视图`:
  `AssertionError: expected [ { itemId: 'sys-1', …(5) } ] to have a length of +0 but got 1`
- 证据:① 本分支与 origin/master 在 `apps/ai-game-creator-shell/{src,tests}` 与 `packages/**` diff 为空
  (零前端改动);② master 自己的 run 3715(head 9cd290362)同一 job 同一用例同一断言同样失败
  ⇒ master 自带红色,与本分支无关;不擅自改、不合别人的分支。

验证(取数前 cargo clean -p genarrative-ai-game-creator-shell):bin EXIT 0 / 0 warning;
--all-targets EXIT 0(harness 实例 382);check:rustfmt / check:encoding(5549 文件)/ git diff --check 全 EXIT 0;
六组测试 6 / 17 / 74 / 1 / 65 / 4 全部 0 failed;另 process_tree::tests 3 passed。
This commit is contained in:
2026-10-07 18:39:14 +08:00
parent 694b545062
commit ad33d42bc7
@@ -304,8 +304,11 @@ mod tests {
use std::process::Stdio;
use tokio::io::{AsyncBufReadExt, AsyncWriteExt};
// 夹具用 `--exact` 复跑本测试二进制,这个字符串必须与真实模块路径逐字一致;本模块随
// codex provider 收敛挂到 `agent::codex_provider::app_server::` 下,故同步更新(否则子进程跑 0 个用例、
// 父进程等 marker 超时 → `Elapsed(())`)。
const FIXTURE: &str =
"agent::codex_app_server::process_tree::tests::owned_tree_process_fixture";
"agent::codex_provider::app_server::process_tree::tests::owned_tree_process_fixture";
#[cfg(target_os = "linux")]
#[test]