MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / parseRequestTimeoutFlag

Function parseRequestTimeoutFlag

src/commands/test.ts:7693–7698  ·  view source on GitHub ↗

* Parse the `--request-timeout ` flag value into milliseconds. * Returns `undefined` when the flag was not supplied (factory falls back to * the env var / default). Silently clamps out-of-range values.

(raw: string | undefined)

Source from the content-addressed store, hash-verified

7691 * the env var / default). Silently clamps out-of-range values.
7692 */
7693function parseRequestTimeoutFlag(raw: string | undefined): number | undefined {
7694 if (raw === undefined) return undefined;
7695 const n = Number(raw);
7696 if (!Number.isFinite(n) || n <= 0) return undefined;
7697 return Math.round(n * 1000); // seconds → milliseconds
7698}
7699
7700/** D4: headroom added on top of `--timeout` when deriving the per-request window under `--wait`. */
7701const WAIT_REQUEST_TIMEOUT_CUSHION_MS = 5_000;

Callers 1

resolveCommonOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected