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:
sim
2026-09-09 07:05:48 -04:00
parent fd37b6a171
commit ab0405ad22
9 changed files with 82 additions and 24 deletions

View File

@@ -1099,6 +1099,12 @@ let savedHome;
let savedUserProfile;
let restoreConfigEnv;
/**
* Runs the real verify-reapply-patches.cjs CLI against patches+config
* fixture dirs. Pre-existing value, unchanged by this migration (#4514).
*/
const VERIFY_REAPPLY_TIMEOUT_MS = 60000;
function writeFile(absPath, content) {
fs.mkdirSync(path.dirname(absPath), { recursive: true });
fs.writeFileSync(absPath, content);
@@ -1110,7 +1116,7 @@ function runVerifier() {
'--patches-dir', patchesDir,
'--config-dir', configDir,
'--json',
], { timeoutMs: 60_000 });
], { timeoutMs: VERIFY_REAPPLY_TIMEOUT_MS });
return {
status: r.exitCode,
report: r.stdout && r.stdout.length ? JSON.parse(r.stdout) : null,
@@ -1238,6 +1244,14 @@ function resetFixture() {
fs.mkdirSync(pristineDir);
}
/**
* Runs the real verify-reapply-patches.cjs CLI against patches+config+
* pristine fixture dirs -- a distinct describe-block scope from the other
* runVerifier() above (different fixture, different pre-existing budget).
* Pre-existing value, unchanged by this migration (#4514).
*/
const VERIFY_REAPPLY_PRISTINE_TIMEOUT_MS = 30000;
function runVerifier() {
const r = runNode([
SCRIPT,
@@ -1245,7 +1259,7 @@ function runVerifier() {
'--config-dir', configDir,
'--pristine-dir', pristineDir,
'--json',
], { timeoutMs: 30_000 });
], { timeoutMs: VERIFY_REAPPLY_PRISTINE_TIMEOUT_MS });
return {
status: r.exitCode,
report: r.stdout && r.stdout.length ? JSON.parse(r.stdout) : null,