test(download): 补强最后一跳 + 写明「抓得住/抓不住」(M292 r1)
复审与塔的门禁在本 worktree 报了一条 `left: 120s / right: 300s` (`changed_settings_reach_the_engine_config_and_the_budget`)。归因结论:**不是源码缺陷**, 是目标目录里跑到了不属于这棵树的 `unlucky_core` 测试二进制。本轮只做两件事: ## 1. 最后一跳补强(presenter) `the_three_timeout_keys_travel_from_the_file_to_the_engine_config` 此前是自己拼 `tuning.apply_to(EngineConfig::default())`,即「调优 → 引擎」这一跳是**用例自己接的**, 守不住「宿主有没有把调优交给 core」。现在改走 GUI 的生产装配点 `crate::host::engine::engine(&env)`(内部 `apply_tuning` → `shared::set_tuning` → 按数据根重建), 断言读 `engine.config()`。这一步断了(宿主没调 `apply_tuning`、或 `shared` 装配点没用 `apply_to`),三条断言全红。 ## 2. 用例文档写清边界(config/tests.rs) `changed_settings_reach_the_engine_config_and_the_budget` 的文档补上返工取证: - **抓得住**(三键逐一变异,删掉 `apply_to` 里对应赋值即红): `response_timeout` ⇒ 278 行 `60s/180s`;`chunk_stall_timeout` ⇒ 279 行 `120s/300s`; `min_avg_throughput` ⇒ 280 行 `32768/16384`。另抓 `from_raw` 的 KiB→字节换算与 `chunk_job_budget` 忽略下限。 - **抓不住**:①宿主有没有调用 `tuning`/`apply_to`(前半段归宿主用例);②跑的是不是这棵树的 二进制(编译期常量与代码内容都不在它视野里 —— 本轮就栽在这里)。 `config/tests.rs` 因此从 394 → 398 行(仍在 400 硬线内)。
This commit is contained in:
1 parent
2ecb33afae
commit
f6cdbff885
2 files changed
+19
-9
No files matched your search
@@ -256,12 +256,16 @@ fn the_timeout_keys_are_single_sourced_and_default_to_todays_values() {
|
||||
);
|
||||
}
|
||||
|
||||
/// **键变更真的进到引擎配置**(P21 判据的 core 侧一半):改设置 ⇒ `apply_to` 之后引擎拿到新值 ⇒
|
||||
/// 分块作业的总期限跟着变。
|
||||
/// **键变更真的进到引擎配置**(P21 判据的 core 侧一半):改设置 ⇒ `apply_to` 后引擎拿到新值 ⇒ 期限跟着变。
|
||||
///
|
||||
/// 变异证明:把 `apply_to` 里任意一行赋值删掉 ⇒ 对应的 `assert_eq!` 红;把 `from_raw` 里
|
||||
/// KiB→字节的 `* 1024` 删掉 ⇒ 吞吐下限那条红(值差 1024 倍);把 `chunk_job_budget` 改回用
|
||||
/// `MIN_AVG_THROUGHPUT` 常量 ⇒ 最后两条期限断言红(改设置对期限无效)。
|
||||
/// **抓得住**(三键逐一变异过,删掉 `apply_to` 里对应赋值即红):`response_timeout` ⇒ 278 行
|
||||
/// `60s/180s`;`chunk_stall_timeout` ⇒ 279 行 `120s/300s`;`min_avg_throughput` ⇒ 280 行
|
||||
/// `32768/16384`。另外还抓 `from_raw` 的 KiB→字节换算(少乘 1024 ⇒ 第三条红)与 `chunk_job_budget`
|
||||
/// 忽略下限(改回常量 ⇒ 最后两条期限断言红)。
|
||||
///
|
||||
/// **抓不住**:①**宿主有没有调用 `tuning`/`apply_to`** —— 前半段归宿主用例(CLI 读 `engine.config()`、
|
||||
/// presenter 走 `host::engine::engine`);②**跑的是不是这棵树的二进制** —— M292 返工就被这一类骗过
|
||||
/// 一轮:异树/旧目标目录里的二进制正好在 279 行报 `120s/300s`,源码却从一开始就有那行。
|
||||
#[test]
|
||||
fn changed_settings_reach_the_engine_config_and_the_budget() {
|
||||
let tune = DownloadTuning::from_raw(RawTuning {
|
||||
|
||||
Reference in new issue
Block a user