Repository navigation
Conversation
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the e2e cleanup timeout changes.
No open issues 🎉
What changed in this PR
This PR gives e2e cleanup hooks enough time for the tsserver fixture to report a stalled process before Vitest reports a generic hook timeout.
Changes:
- Applies the same timeout headroom to e2e tests and hooks.
- Caps the response timeout so adding headroom stays within Node’s maximum timer delay.
- Adds focused regression tests, maintenance documentation, and a patch changeset.
| File | Description |
|---|---|
vitest.config.ts |
Shares the derived timeout between e2e tests and hooks. |
test/unit/vitest-config.test.ts |
Checks e2e project wiring and timeout settings. |
test/unit/tsserver-timeouts.test.ts |
Tests acceptance and rejection at the response-timeout cap. |
test/e2e/tsserver-fixture/timeouts.ts |
Defines shared headroom and bounds the configured response timeout. |
docs/maintenance.md |
Explains cleanup timeout behavior. |
.changeset/calm-cleanup-hooks.md |
Records the cleanup timeout fix for release. |
Review effort: Balanced
There was a problem hiding this comment.
ℹ️ No critical issues — two minor suggestions inline.
Reviewed changes
- Cleanup hook headroom: the e2e project now sets
hookTimeoutto the sameresponseTimeoutMs + E2E_TIMEOUT_HEADROOM_MSastestTimeout, soonTestFinished/afterAllcleanup can let the harness's ownclose()deadline fire first. - Bounded response timeout:
MAX_RESPONSE_TIMEOUT_MScapsTSSERVER_RESPONSE_TIMEOUT_MSatMAX_TIMER_DELAY_MS - E2E_TIMEOUT_HEADROOM_MS, andparsePositiveIntegeraccepts an explicit maximum so the derived hook timeout stays inside Node's timer range. - Testable e2e config: the e2e project is lifted into exported
e2eTestConfig/e2eProjectConfig, withe2eTimeoutMsderived once and reused by both timeouts. - Tests, docs, changeset: new parser-cap and config-wiring unit tests, a maintenance doc note, and a patch changeset.
I confirmed against Vitest 5.0.5 that both onTestFinished and afterAll use runner.config.hookTimeout (node_modules/vitest/dist/chunks/run.BPv-BBRv.js:3411 and :1972), so the premise holds. Focused tests, the full unit suite (937 tests), typecheck, lint, and format:check pass locally.
big-pickle (free) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Production cap now covered: the
responseTimeoutMscomputation moved into exportedgetResponseTimeoutMs(value), so the unit tests exercise theMAX_RESPONSE_TIMEOUT_MScap through the real entry point rather than re-supplying a bound. Tests cover the default, accepted values including the cap, and rejection at cap + 1 with the exact message. - Changeset dropped: the earlier
.changeset/calm-cleanup-hooks.mdwas removed, since this is test-harness-only work with no user-visible change. - Rest unchanged:
e2eTimeoutMsstill derivesresponseTimeoutMs + E2E_TIMEOUT_HEADROOM_MSfor bothhookTimeoutandtestTimeout, keeping the derived timeout within Node's maximum timer delay.
Both prior review threads are addressed and resolved. Focused tests (17), typecheck, and lint pass at c32c0ae.
big-pickle (free) | 𝕏

Summary
Give Vitest's e2e cleanup hooks the same timeout headroom as e2e test bodies. This lets the tsserver fixture's own process-exit deadline report a stalled server instead of Vitest ending
onTestFinishedorafterAllfirst with a generic hook timeout.The response-timeout parser now reserves that headroom below Node's maximum timer delay. The Vitest e2e project configuration derives both
testTimeoutandhookTimeoutfrom the bounded response timeout, and focused tests cover the parser cap and project wiring.Testing
corepack yarn vitest run test/unit/tsserver-timeouts.test.ts test/unit/vitest-config.test.ts --configLoader runnerAll 13 focused tests pass.