test(cli): allow shared readiness budget to expire in earlier phases

This commit is contained in:
ldm0
2026-10-20 12:29:47 +08:00
committed by Donough Liu
parent 3ca6888b9d
commit 7ee8c887da
+9 -8
View File
@@ -2469,11 +2469,12 @@ fn cli_readiness_plan_does_not_restart_timeout_for_script() -> Result<()> {
let stdout = clean_output(&output.stdout);
let stderr = clean_output(&output.stderr);
assert!(stdout.is_empty(), "stdout={stdout}");
// Under contention an earlier readiness phase can consume the budget.
// The shared-deadline contract does not require reaching the script wait;
// phase-specific diagnostics are covered separately below.
assert!(
stderr.contains(
"fetch readiness timed out after 700 ms while waiting for a script to become truthy"
),
"the shared deadline should expire during the final plan phase: stderr={stderr}"
stderr.contains("fetch readiness timed out after 700 ms while "),
"all readiness phases must use the original timeout budget: stderr={stderr}"
);
Ok(())
}
@@ -3652,11 +3653,11 @@ fn cli_http_error_replacement_and_post_waits_share_one_deadline() -> Result<()>
let stdout = clean_output(&output.stdout);
let stderr = clean_output(&output.stderr);
assert!(stdout.is_empty(), "stdout={stdout}");
// Replacement navigation and the response/selector waits can exhaust the
// shared budget before the script wait starts, especially under CI load.
assert!(
stderr.contains(
"fetch readiness timed out after 850 ms while waiting for a script to become truthy"
),
"the replacement and earlier post waits should leave the script phase with only the remaining budget: stderr={stderr}"
stderr.contains("fetch readiness timed out after 850 ms while "),
"replacement navigation and post waits must use the original timeout budget: stderr={stderr}"
);
Ok(())
}