Repository navigation
Conversation
test/automation/pull-requests/growth-guardrails.test.ts's beforeAll calls loadGrowthGuardrailDiff(), which for a real PR event runs preparePullRequestTree(): up to two sequential git fetches (base history, then the PR head ref), each individually budgeted up to 30s, plus a merge-tree construction. Vitest's own unconfigured hookTimeout default is 10s, shorter than that budget, so the hook can time out even when every git command finishes within its own 30s allowance. Hit this exactly on PR NVIDIA#13925: the job failed with vitest's own "configure it globally with hookTimeout" message after ~16s, well under what a shallow-clone base-history fetch can legitimately take. Set hookTimeout on the "integration" vitest project (where this test lives) to comfortably exceed two sequential 30s fetches, using the existing testTimeout() env-override helper for consistency with the project's other timeout values. Verified locally: reproduced with the exact BASE_SHA/HEAD_SHA/PR_NUMBER from the failing run (f568a3f.../6cb0295.../13925) against a shallow clone matching CI's checkout depth. Before this change the beforeAll hook is the one that times out. After, the hook completes in ~0.5s (confirmed directly: the two real git fetches against this PR's actual commits take well under a second once run back to back); the test then hits an unrelated local-environment limitation (this machine's git 2.34.1 predates `git merge-tree --write-tree`, which the helper uses, and which GitHub Actions' runner git supports) -- that failure is specific to this local verification environment, not the CI bug this change fixes. The same "Codebase growth guardrails" pre-commit hook on this very commit also passed, exercising the fix end to end. Signed-off-by: Siddhardha Nanda <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The
codebase-growth-guardrailscheck on #13925 fails on abeforeAllhook timeout ingrowth-guardrails.test.ts, before any of the 7 real guardrail checks run (all reported skipped). Confirmed deterministic, not a flake: an empty retrigger commit on #13925 reproduced the identical failure, same line, same timeout.Root cause
beforeAllcallsloadGrowthGuardrailDiff(), which for a real PR event runspreparePullRequestTree(): up to two sequential git fetches (base history + PR head), each individually budgeted 30s internally. Vitest's own unconfiguredhookTimeoutdefault is 10s, shorter than that internal budget, so the hook can time out even when every git command finishes within its own allowance.Fix
vitest.config.ts: added an explicithookTimeouton the "integration" project (where this test lives), using the existing env-overridabletestTimeout()helper for consistency.Verified
BASE_SHA/HEAD_SHA/PR_NUMBERfrom the failing Enforce Hermes's 64k Ollama context-window floor on inference set, no… #13925 run, against a shallow clone matching CI's depth. Before the fix: hook times out. After: completes in ~0.5s.git commitand passed, exercising the fix through the real tooling.Summary by CodeRabbit