Skip to content

Fix codebase-growth-guardrails beforeAll hook timeout - #14832

Open
SID-6921 wants to merge 1 commit into
NVIDIA:mainfrom
SID-6921:fix-growth-guardrails-hook-timeout
Open

SID-6921 wants to merge 1 commit into
NVIDIA:mainfrom
SID-6921:fix-growth-guardrails-hook-timeout

Conversation

@SID-6921

@SID-6921 SID-6921 commented Nov 24, 2026 •

Copy link
Copy Markdown

The codebase-growth-guardrails check on #13925 fails on a beforeAll hook timeout in growth-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

beforeAll calls loadGrowthGuardrailDiff(), which for a real PR event runs preparePullRequestTree(): up to two sequential git fetches (base history + PR head), each individually budgeted 30s internally. Vitest's own unconfigured hookTimeout default 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 explicit hookTimeout on the "integration" project (where this test lives), using the existing env-overridable testTimeout() helper for consistency.

Verified

  • Reproduced the exact failure using the real BASE_SHA/HEAD_SHA/PR_NUMBER from 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.
  • The repo's own pre-commit hook for this exact guardrail check ran during git commit and passed, exercising the fix through the real tooling.

Summary by CodeRabbit

  • Tests
    • Increased the time limit for integration test setup hooks.

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]>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:41
@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The integration Vitest project sets hookTimeout to testTimeout(70_000). Adjacent comments describe the growth-guardrail setup hook and its sequential fetch budget.

Changes: Integration test configuration

Layer / File(s) Summary
Set integration hook timeout
vitest.config.ts
The integration project sets hookTimeout to testTimeout(70_000).

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: deepujain, cv

Merge Risk: Minimal · up to c61c3

This change raises the setup-hook timeout for integration tests so the growth-guardrails check no longer times out during its sequential Git fetches. It has no production impact, and I found no merge-blocking risk.

Security architecture risk: Minimal · up to c61c3

The change gives integration test setup more time to finish without changing what it can access or what it does.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix and the affected test hook, "beforeAll hook timeout" in codebase-growth-guardrails. The change adds an explicit hookTimeout of testTimeout(70_000) to the integration Vitest pro…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix and the affected test hook, "beforeAll hook timeout" in codebase-growth-guardrails. The change adds an explicit hookTimeout of testTimeout(70_000) to the integration Vitest project, which is where that hook runs. The title matches the main change in the changeset and is specific enough for a reviewer scanning history.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b796c61 and c61c352.

Files selected for processing: 1

  • vitest.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants