Batch 11 of the ad hoc timeout literal migration (epic #4445). Replaces every bare numeric timeout/timeoutMs object-literal property in tests/state-document.test.cjs, tests/phase.test.cjs, tests/commands.test.cjs, tests/pattern.test.cjs, tests/adr-612-bracket-coherence.test.cjs, tests/adr-612-bracket-read-tolerance.test.cjs, tests/milestone-lock.test.cjs, tests/init.test.cjs, tests/state-todos-render.test.cjs, tests/quick-batch.test.cjs, tests/graphify.test.cjs, and tests/effort-surface-axis.test.cjs with a named constant, per eslint-rules/no-adhoc-timeout-literal.cjs. Removes these 12 files from the rule's allowlist. Ground truth via eslint found 25 sites, not the issue's stated 24 (phase.test.cjs has 5, not 4) -- disclosed in the PR body. Reuses PROBE_TIMEOUT_MS, GIT_TIMEOUT_MS, and LOOP_HOOK_POINT_CLI_TIMEOUT_MS across 8 files. Adds two new shared constants to tests/helpers/timeouts.cjs (each independently arrived at by 2 files in this batch, crossing the promotion bar): PATHOLOGICAL_INPUT_TEST_TIMEOUT_MS (node:test's own per-test timeout option, not a subprocess bound) and GSD_TOOLS_CLI_MODERATE_TIMEOUT_MS (a single gsd-tools.cjs CLI subcommand spawn, distinct tier from PROBE_TIMEOUT_MS/LOOP_HOOK_POINT_CLI_TIMEOUT_MS). Adds 3 file-local constants for values used by only 1 file in this batch. No src/bin file touched, no numeric value changed anywhere. Co-authored-by: sim <sim@local> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,15 @@ function saveSurfacedEnv() {
|
||||
// Require capability-state to assert gate parity in regression tests below.
|
||||
const { isCapabilityActive } = require('../gsd-core/bin/lib/capability-state.cjs');
|
||||
|
||||
/**
|
||||
* NOT a real subprocess timeout. spawnSync is fully mocked in this test --
|
||||
* this is test-input/fixture data proving an explicit timeout override is
|
||||
* correctly forwarded from execGraphify's options into the (fake) spawnSync
|
||||
* call. Renamed at BOTH the call site and the assertion site so the
|
||||
* override-forwarding check keeps its teeth.
|
||||
*/
|
||||
const MOCK_TIMEOUT_OVERRIDE_FIXTURE_MS = 60000;
|
||||
|
||||
describe('status', () => {
|
||||
// ─── Tri-state gate (Phase 3 cutover from isGraphifyEnabled → isCapabilityActive) ──
|
||||
//
|
||||
@@ -535,8 +544,8 @@ describe('build', () => {
|
||||
return { status: 0, stdout: '', stderr: '', error: undefined, signal: null };
|
||||
});
|
||||
|
||||
execGraphify('/tmp', ['build'], { timeout: 60000 });
|
||||
assert.strictEqual(captured.timeout, 60000);
|
||||
execGraphify('/tmp', ['build'], { timeout: MOCK_TIMEOUT_OVERRIDE_FIXTURE_MS });
|
||||
assert.strictEqual(captured.timeout, MOCK_TIMEOUT_OVERRIDE_FIXTURE_MS);
|
||||
});
|
||||
|
||||
test('trims stdout and stderr whitespace', () => {
|
||||
|
||||
Reference in New Issue
Block a user