Skip to content

fix(cli): give integration hooks the same timeout as integration tests - #1132

Merged
blafourcade merged 2 commits into
nextfrom
fix/integration-hook-timeout
Oct 30, 2026
Merged

blafourcade merged 2 commits into
nextfrom
fix/integration-hook-timeout

Conversation

@blafourcade

@blafourcade blafourcade commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

Give the integration vitest project a 60s hookTimeout, matching its testTimeout. A beforeEach that spawns git hit vitest's 10s hook default on a loaded Windows runner, while the tests it sets up already had 60s.

🛠️ How it works

  • telemetry-lifecycle.integration.test.ts builds a throwaway git repository in beforeEach (init, remote add, commit). Under the full integration project on Windows the spawn cost roughly doubles against an idle machine, and one stall past 10s failed the hook. The rerun passed.
  • Two files, consent-scenarios and telemetry-lifecycle, hold about three quarters of the project's spawned processes, so they carry most of the exposure.
  • Rejected: a repository template copied per test (about a fifth of the spawns, and it risks the clone-identity scenarios), retry (would hide real flakes), and --max-workers=2 (no consistent gain measured).
  • Applied to vitest.mutation.config.ts too, since it declares its own integration project.
  • Second commit: consent-scenarios wrote its stand-in aidd as an extensionless shebang file. The hook only finds aidd through PATHEXT on Windows, so the stand-in was skipped and a globally installed aidd answered instead; without one, the hand key and copy at the path rows failed. On Windows it now writes aidd.cmd with its CLI entry beside it, which resolveAidd runs with node.

🧪 How to verify

  • cd cli && pnpm exec vitest run --project integration tests/contexts/telemetry/telemetry-lifecycle.integration.test.ts tests/contexts/telemetry/consent-scenarios.integration.test.ts
  • On Windows, with no aidd on PATH, the consent scenarios pass.

⚠️ Heads-up

  • The timeout is a guard, not a speed-up. The product resolves a repository's identity with three git calls each time; fewer calls would help Windows users too, as a separate change.
  • e2e has the same gap and no observed failure, so it is untouched.

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

A beforeEach that spawns git ran past vitest's 10s hook default on a loaded Windows runner, while tests already had 60s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@blafourcade
blafourcade requested a review from a team as a code owner October 30, 2026 04:44
The hook only finds aidd through PATHEXT there, so the extensionless stand-in was skipped and a globally installed aidd answered instead. Without one, the hand key and copy rows failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@blafourcade
blafourcade merged commit cc8aa8c into next Oct 30, 2026
65 checks passed
@blafourcade
blafourcade deleted the fix/integration-hook-timeout branch October 30, 2026 05:05
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.

1 participant