Skip to content

test(tsrx-mcp): allow 30s per test so a cold compiler import under load does not time out - #1106

Merged
jonkwheeler merged 1 commit into
tsrx-org:mainfrom
jonkwheeler:test/tsrx-mcp-timeout
Nov 12, 2026
Merged

jonkwheeler merged 1 commit into
tsrx-org:mainfrom
jonkwheeler:test/tsrx-mcp-timeout

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The tsrx-mcp tests now allow 30 seconds per test instead of Vitest's 5-second default. This guards against load-induced timeouts and doesn't change any product behavior.

  • Before: hono-mode.test.js > Hono MCP runtime selection > rejects async components in client mode sometimes failed with "Test timed out in 5000ms" during a full parallel pnpm test. It is the first test in its file, and the first compile_tsrx call loads the target compiler with a cold dynamic import() (import_compiler in packages/tsrx-mcp/src/compile.js). When every project runs at once, that import can take longer than 5 seconds.
  • After: the tsrx-mcp project sets testTimeout: 30_000, as the tsrx-utils project does. The tests check results, not speed, so the timeout only has to catch a hang. The project-level setting also covers the other tsrx-mcp files whose first test pays for a cold import (compile.test.js, http.test.js, package.test.js).

No warm-up hook: a beforeAll that imports the compiler would move the same cold import into a hook with its own 10-second default timeout, and that hook would then be the step that can time out. The longer test timeout is the guard either way.

Verification

  • The flake didn't reproduce in isolation, here or in triage: npx vitest run --project tsrx-mcp passes 83/83 in about 5 seconds, before and after.
  • A throwaway test in packages/tsrx-mcp/tests/ that waits 6 seconds passes with this config. Under the 5-second default it would time out. The probe is not committed.
  • Full npx vitest run (all three of my branches merged locally, on a machine with load average 50-75 from parallel runs): 10,002 passed, 82 skipped, 10 failed. All 10 are "Test timed out in 5000ms" in projects this PR doesn't touch (content-mapper, typescript-plugin, tsrx-vue). Those three projects pass in full with --testTimeout=60000 (1,284 passed, 15 skipped). pnpm typecheck is clean, pnpm changeset:check passes, and Prettier passes on the changed files.

No changeset: test configuration only.

Related

Fixes #310

🤖 Generated with Claude Code


Note

Low Risk
Test-only Vitest project configuration; no production code or runtime behavior changes.

Overview
Raises the Vitest per-test timeout for the tsrx-mcp project from the default 5s to 30s, matching tsrx-utils. This stops flaky "Test timed out in 5000ms" failures when a full parallel run is under load: the first compile_tsrx in a file triggers a cold dynamic import() of the compiler and can exceed 5s without indicating a real bug.

Adds an inline comment that the limit is only meant to catch hangs, since assertions are about correctness—not speed. No product or runtime behavior changes; test config only (fixes #310).

Reviewed by Cursor Bugbot for commit 39ea600. Bugbot is set up for automated code reviews on this repo. Configure here.

…oad does not time out (tsrx-org#310)

The first `compile_tsrx` call in a file loads the target compiler with a
dynamic `import()`. During a full parallel run that cold import can take
longer than Vitest's 5s default, and `hono-mode.test.js > rejects async
components in client mode`, the first test in its file, failed once in three
full runs. The project now sets `testTimeout: 30_000`, as `tsrx-utils` does.
The tests check results, not speed, so the timeout only has to catch a hang.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

[Bug]: tsrx-mcp Hono runtime test times out during a full test run

1 participant