fix(cli): honor check navigation timeout (#2860)

* fix(cli): honor check navigation timeout

* test(cli): clarify diagnostic timeout precedence
This commit is contained in:
Miguel Ángel
2026-07-29 20:50:20 +02:00
committed by GitHub
parent 6cfb05e38b
commit fdc5932897
9 changed files with 60 additions and 7 deletions
+10 -2
View File
@@ -118,12 +118,20 @@ export function resolveBrowserTimeoutMsArg(raw: string | undefined): number | un
return result.value;
}
/** Navigation budget shared by snapshot/check/inspect browser diagnostics. */
/**
* Navigation budget shared by snapshot/check/inspect browser diagnostics.
*
* The environment variable remains the historical global override. Callers
* with their own timeout knob can supply a minimum without shortening that
* override or the existing 10-second default.
*/
export function resolveDiagnosticNavigationTimeoutMs(
env: Record<string, string | undefined> = process.env,
minimumTimeoutMs = 0,
): number {
const parsed = Number(env.PRODUCER_PAGE_NAVIGATION_TIMEOUT_MS);
return Number.isFinite(parsed) && parsed > 0 ? parsed : 10_000;
const configured = Number.isFinite(parsed) && parsed > 0 ? parsed : 10_000;
return Math.max(configured, minimumTimeoutMs);
}
// ── --composition ──────────────────────────────────────────────────────