From 16393531504ae94c85039f3feb1ec6641075858c Mon Sep 17 00:00:00 2001 From: KiriAky 107 Date: Wed, 9 Sep 2026 07:32:24 +0800 Subject: [PATCH] =?UTF-8?q?test(sandbox):=20=E5=B0=86=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=8E=A2=E6=B5=8B=E9=A2=84=E7=AE=97=E4=B8=8E=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenNexus生产化实施进度-2026-09-08.md | 9 +++++++++ frontend/src-tauri/src/extension_container.rs | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/development/OpenNexus生产化实施进度-2026-09-08.md b/docs/development/OpenNexus生产化实施进度-2026-09-08.md index 14ce40d..a800877 100644 --- a/docs/development/OpenNexus生产化实施进度-2026-09-08.md +++ b/docs/development/OpenNexus生产化实施进度-2026-09-08.md @@ -742,3 +742,12 @@ Core 的独立数据目录目前不等于已授权 Vault。Python 旧笔记写 - Rust 首次含新增用例的并行全套出现既有 AppContainer 测试失败:启动参数/环境辅助进程返回 1(不是网络越权判定),日志 .build/scope-wired-final-rust.log。单独复核同一实际探测通过,16.94 秒(.build/scope-native-recheck.log),原因尚未定位;保留此失败,不据此宣称全套稳定。随后对最终代码串行全量验证,结果另列。 - 最终串行 desktop 全目标 143 通过、12 ignored(库 128、Host 8、其余集成 7),含第三客户端关闭/重开范围的实际 HTTP 验证,日志 .build/scope-wired-final-serial.log;补充旧队列测试单独 1 项通过(.build/scope-old-queue-final.log),累计覆盖 144 项通过用例。最终全目标 Clippy -D warnings 通过(.build/scope-wired-clippy.log)。 - 本轮修正了先前人设/布局默认进入同步的规划偏差;仅这两类可选记录已经接通选择与传输。尚未实现的可选数据类、完整发布/兼容、独立设备 UI 和上述偶发 native 失败原因仍需处理,完整生产化目标未完成。 + + +## 增量:原生启动探针的许可预算与故障诊断 + +- 追查先前并行回归退出码 1:失败位置是正常 argv/environment 启动探针,而不是回环网络越权检查。该探针 Claims.expires_at_ms 原为 1000,prepare 使用 now_ms=2,Lease 将其转换为约 998 ms 的 Instant 剩余寿命;但进程等待允许 5 秒。调度/启动耗时超过许可时,Watch 会终止 Job,退出码也是 1。 +- 历史失败未记录授权状态,不能据此确认唯一根因。已修复可确定的测试预算不一致:正常启动探针采用 120 秒测试许可,与其他正常原生协议探针一致;进程完成仍须在 5 秒观察窗口内,不延长实际启动成功条件。独立 cause=expiry 的两秒 Lease 及自动终止/EXTENSION_PERMIT_EXPIRED 断言保持原样,生产许可/资源/撤销实现没有修改。 +- 启动断言失败时增加耗时、授权错误机器码、活动进程数诊断,不输出 argv、环境、凭据或用户路径,便于后续区别许可撤销、资源终止与程序自身异常。 +- 第一轮默认并行 desktop library 回归 129 通过、10 ignored,21.72 秒,含实际正常启动、网络和短期许可到期用例,日志 .build/native-budget-parallel-1.log;后续重复结果另列。 +- 第 2、3 轮同样默认并行运行,各 129 通过、10 ignored,分别 21.24 与 20.88 秒,日志 .build/native-budget-parallel-2.log、.build/native-budget-parallel-3.log。三轮共 387 次通过执行,不能将重复执行数当作独立测试数量。全目标 Clippy -D warnings 通过(.build/native-budget-clippy.log)。本轮仅修改原生测试探针预算和诊断,不改变生产安全策略;历史偶发失败根因未获得完整现场证明,整个生产化目标仍未完成。 diff --git a/frontend/src-tauri/src/extension_container.rs b/frontend/src-tauri/src/extension_container.rs index 4e4473d..f6892d5 100644 --- a/frontend/src-tauri/src/extension_container.rs +++ b/frontend/src-tauri/src/extension_container.rs @@ -822,7 +822,10 @@ mod tests { vault_id: uuid::Uuid::new_v4().to_string(), platform: "windows".into(), policy_version: "1".into(), - expires_at_ms: 1000, + // This probe checks argv/environment, not expiry. Keep its permit + // longer than the bounded process observation under parallel load. + // The dedicated expiry probe below still uses a two-second lease. + expires_at_ms: 120_000, }; broker .put( @@ -839,14 +842,20 @@ mod tests { container_data: &folder, scratch: &folder.join("Temp"), }; + let launch_started = std::time::Instant::now(); let prepared = context .prepare(&authority, &permit, &claims, &bound_entry, &broker, 2) .unwrap(); let suspended = prepared.create_suspended(&profile, &bound_entry).unwrap(); let running = unsafe { suspended.resume().unwrap() }; + let exit = running.wait(std::time::Duration::from_secs(5)).unwrap(); assert_eq!( - running.wait(std::time::Duration::from_secs(5)).unwrap(), - Some(0) + exit, + Some(0), + "launch probe elapsed={:?} authorization={:?} active_processes={:?}", + launch_started.elapsed(), + running.check_authorization().err().map(|error| error.code), + running.active_test_processes().ok(), ); drop(running); // Actual native RPC: the child cannot name an identity or connect to