test(#4514): migrate git-adjacent workflow checks to named timeout constants
Batch 3 of the ad hoc timeout literal migration (epic #4445). Replaces every bare numeric timeout/timeoutMs object-literal property in tests/ci-rebase-check.test.cjs, tests/gsd-validate-commit-crash-policy.test.cjs, tests/pr-branch-planning-filter.test.cjs, tests/reapply-verify-hunks.test.cjs, tests/ship-notes-wedged-pr.test.cjs, tests/slug-derivation-drift-guard.test.cjs, and tests/worktree-safety.test.cjs with a named constant, per eslint-rules/no-adhoc-timeout-literal.cjs. Removes the 7 files from the rule's allowlist. Mints a new shared class norm, QUICK_SPAWN_TIMEOUT_MS (10000ms), in tests/helpers/timeouts.cjs: 5 sites across 4 of this batch's files had independently arrived at the same value for the same shape (a cheap, trivial subprocess/hook invocation with no real git/network/fan-out work). No src/bin file touched, no numeric value changed anywhere. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,17 @@ const path = require('node:path');
|
||||
const { createTempDir, cleanup, TEST_ENV_BASE } = require('./helpers.cjs');
|
||||
const { runHook, OUTCOME } = require('./helpers/process-seam.cjs');
|
||||
|
||||
/**
|
||||
* gsd-validate-commit.sh is invoked via bash and internally fans out to
|
||||
* nested `node -e` calls (the classifier/config-read/JSON-extraction
|
||||
* sites this file's own header docblock describes) -- conceptually the
|
||||
* same shape `HOOK_FANOUT_TIMEOUT_MS` (60000ms) describes, but this hook
|
||||
* sits at a much lighter pre-existing value. Not reclassified/raised: no
|
||||
* bench citation exists for whether this specific hook needs more.
|
||||
* Pre-existing value, unchanged by this migration (#4514).
|
||||
*/
|
||||
const VALIDATE_COMMIT_HOOK_TIMEOUT_MS = 15000;
|
||||
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'gsd-validate-commit.sh');
|
||||
|
||||
const CONFORMING_COMMIT_PAYLOAD = JSON.stringify({
|
||||
@@ -94,7 +105,7 @@ function runValidateCommit({ payload, cwd, env } = {}) {
|
||||
cwd,
|
||||
env: { ...process.env, ...TEST_ENV_BASE, ...env },
|
||||
input: payload,
|
||||
timeoutMs: 15000,
|
||||
timeoutMs: VALIDATE_COMMIT_HOOK_TIMEOUT_MS,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user