Repository navigation
test(tsrx-mcp): allow 30s per test so a cold compiler import under load does not time out - #1106
Merged
Merged
Conversation
…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]>
jonkwheeler
marked this pull request as ready for review
October 26, 2026 19:57
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
hono-mode.test.js > Hono MCP runtime selection > rejects async components in client modesometimes failed with "Test timed out in 5000ms" during a full parallelpnpm test. It is the first test in its file, and the firstcompile_tsrxcall loads the target compiler with a cold dynamicimport()(import_compilerinpackages/tsrx-mcp/src/compile.js). When every project runs at once, that import can take longer than 5 seconds.tsrx-mcpproject setstestTimeout: 30_000, as thetsrx-utilsproject 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
beforeAllthat 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
npx vitest run --project tsrx-mcppasses 83/83 in about 5 seconds, before and after.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.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 typecheckis clean,pnpm changeset:checkpasses, 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-mcpproject from the default 5s to 30s, matchingtsrx-utils. This stops flaky "Test timed out in 5000ms" failures when a full parallel run is under load: the firstcompile_tsrxin a file triggers a cold dynamicimport()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.