Batch 10 of the ad hoc timeout literal migration (epic #4445). Replaces every bare numeric timeout/timeoutMs object-literal property in tests/adr857-core-without-capabilities.test.cjs, tests/capability-cli.test.cjs, tests/capability-probe-fallback.test.cjs, tests/capability-state.test.cjs, tests/capability-trust.test.cjs, tests/capability-validator-task-content-resolver.test.cjs, and tests/capability-writer.test.cjs with a named constant, per eslint-rules/no-adhoc-timeout-literal.cjs. Removes these 7 files from the rule's allowlist. Reuses the existing PROBE_TIMEOUT_MS constant at 8 sites across 3 files. Adds 7 new file-local constants (no promotion to the shared helper needed this batch -- every new class is confined to exactly one file, below the two-file promotion bar): GSD_TOOLS_CLI_TIMEOUT_MS, FRAGMENT_PROBE_SNIPPET_TIMEOUT_MS, INSTALLED_RUNTIME_CLI_TIMEOUT_MS, FIXTURE_MCP_SERVER_TIMEOUT_VALUE, TASK_RESOLVER_FIXTURE_TIMEOUT_MS, TASK_RESOLVER_TIMEOUT_CEILING_MS, and TASK_RESOLVER_TIMEOUT_CEILING_PLUS_ONE_MS (the last two forming a boundary-coverage limit/limit+1 pair). 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:
@@ -14,6 +14,7 @@ const fs = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const { runNode } = require('./helpers/process-seam.cjs');
|
||||
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
|
||||
const { cleanup } = require('./helpers.cjs');
|
||||
|
||||
@@ -303,7 +304,7 @@ describe('capability-writer: setCapabilityState', () => {
|
||||
// Test: capability set ui --off (--config-dir rcd) exits 0
|
||||
const offResult = runNode([gsdToolsBin, 'capability', 'set', 'ui', '--off', '--config-dir', rcd], {
|
||||
cwd,
|
||||
timeoutMs: 15000,
|
||||
timeoutMs: PROBE_TIMEOUT_MS,
|
||||
});
|
||||
assert.equal(offResult.exitCode, 0,
|
||||
`capability set ui --off should exit 0, got ${String(offResult.exitCode)}. stderr: ${offResult.stderr}`);
|
||||
@@ -311,7 +312,7 @@ describe('capability-writer: setCapabilityState', () => {
|
||||
// Test: capability set ui --on (--config-dir rcd) exits 0
|
||||
const onResult = runNode([gsdToolsBin, 'capability', 'set', 'ui', '--on', '--config-dir', rcd], {
|
||||
cwd,
|
||||
timeoutMs: 15000,
|
||||
timeoutMs: PROBE_TIMEOUT_MS,
|
||||
});
|
||||
assert.equal(onResult.exitCode, 0,
|
||||
`capability set ui --on should exit 0, got ${String(onResult.exitCode)}. stderr: ${onResult.stderr}`);
|
||||
@@ -319,7 +320,7 @@ describe('capability-writer: setCapabilityState', () => {
|
||||
// Test: unknown id exits non-zero
|
||||
const unknownResult = runNode([gsdToolsBin, 'capability', 'set', 'does-not-exist', '--off', '--config-dir', rcd], {
|
||||
cwd,
|
||||
timeoutMs: 15000,
|
||||
timeoutMs: PROBE_TIMEOUT_MS,
|
||||
});
|
||||
assert.notEqual(unknownResult.exitCode, 0,
|
||||
`capability set does-not-exist --off should exit non-zero, got ${String(unknownResult.exitCode)}`);
|
||||
@@ -502,7 +503,7 @@ describe('capability-writer: setCapabilityState', () => {
|
||||
|
||||
const conflictResult = runNode(
|
||||
[gsdToolsBin, 'capability', 'set', 'ui', '--on', '--off', '--config-dir', rcd],
|
||||
{ cwd, timeoutMs: 15000 },
|
||||
{ cwd, timeoutMs: PROBE_TIMEOUT_MS },
|
||||
);
|
||||
assert.notEqual(
|
||||
conflictResult.exitCode, 0,
|
||||
|
||||
Reference in New Issue
Block a user