From 95e6a58fd465111da756f2f0305b7551171570ae Mon Sep 17 00:00:00 2001 From: sim Date: Tue, 8 Sep 2026 19:56:08 -0400 Subject: [PATCH 1/3] test(#4513): migrate git plumbing batch to named timeout constants Batch 2 of the ad hoc timeout literal migration (epic #4445). Replaces every bare numeric timeout/timeoutMs object-literal property in tests/git-base-branch.test.cjs, tests/commit-files-pathspec.test.cjs, and tests/git-fixture.test.cjs with a named constant, per eslint-rules/no-adhoc-timeout-literal.cjs. Removes the 3 files from the rule's allowlist. This batch introduces a violation shape not seen in Batch 1: several sites are pinned-value test assertions verifying the EXACT timeout production code hardcodes (not bounds on this suite's own subprocess calls). Named as four separate constants even where values coincide, so the tests keep catching independent production drift instead of silently tolerating it. No src/bin file touched, no numeric value changed anywhere -- verified site-by-site by two independent isolated review passes. Co-Authored-By: Claude Sonnet 5 --- .../no-adhoc-timeout-literal.allowlist.json | 3 - tests/commit-files-pathspec.test.cjs | 35 +++++++++--- tests/git-base-branch.test.cjs | 55 ++++++++++++++----- tests/git-fixture.test.cjs | 15 ++++- 4 files changed, 79 insertions(+), 29 deletions(-) diff --git a/eslint-rules/no-adhoc-timeout-literal.allowlist.json b/eslint-rules/no-adhoc-timeout-literal.allowlist.json index e76ddb85d..3c04f1103 100644 --- a/eslint-rules/no-adhoc-timeout-literal.allowlist.json +++ b/eslint-rules/no-adhoc-timeout-literal.allowlist.json @@ -26,7 +26,6 @@ "tests/code-review-pipeline-regression.test.cjs", "tests/code-review.test.cjs", "tests/commands.test.cjs", - "tests/commit-files-pathspec.test.cjs", "tests/config-get-default.test.cjs", "tests/cursor-hook-workspace-roots.test.cjs", "tests/cursor-hooks.test.cjs", @@ -46,8 +45,6 @@ "tests/gen-health-docs.test.cjs", "tests/gen-section-manifest.test.cjs", "tests/gen-state-md-docs.test.cjs", - "tests/git-base-branch.test.cjs", - "tests/git-fixture.test.cjs", "tests/graphify.test.cjs", "tests/gsd-check-update-worker-platform-gate.test.cjs", "tests/gsd-mcp-server-bin.test.cjs", diff --git a/tests/commit-files-pathspec.test.cjs b/tests/commit-files-pathspec.test.cjs index 7e6ed04ba..47f760190 100644 --- a/tests/commit-files-pathspec.test.cjs +++ b/tests/commit-files-pathspec.test.cjs @@ -22,7 +22,7 @@ const { createTempGitProject, cleanup, runGsdTools } = require('./helpers.cjs'); const { execFileSync } = require('node:child_process'); const { gitOrThrow } = require('./helpers/git-fixture.cjs'); // #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs. -const { GIT_TIMEOUT_MS } = require('./helpers/timeouts.cjs'); +const { GIT_TIMEOUT_MS, PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs'); const { bareCommandName, tokenize, shellDashCPayloads, commentPortion, ISSUE_REF_RE, declarationReason, isDeclared, isUntrackedDeclaration, @@ -433,6 +433,16 @@ describe('commit --files: pathspec honors declared scope (#2112)', () => { // shared DEFAULT_GIT_TIMEOUT_MS norm. const STAGING_GIT_TIMEOUT_MS = 5000; +/** + * `commitWithFailingAdd`/`subrepoCommitWithFailingAdd` below spawn + * `process.execPath -e