Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The test failures in feedback-overlay-renderers, form-renderers, and layout-data-renderers were caused by beforeAll hooks timing out when importing the renderers module. This was happening due to the default 10s hook timeout being insufficient for complex module imports when tests run in parallel. The fix increases the hookTimeout from 10s (default) to 30s to accommodate the time needed for renderer module initialization, especially when multiple test files are running concurrently. Fixes: https://github.com/objectstack-ai/objectui/actions/runs/21542544467/job/62079189230 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
✅ All checks passed!
|
There was a problem hiding this comment.
Pull request overview
This PR increases the Vitest hook timeout from the default 10 seconds to 30 seconds to resolve CI test failures caused by parallel test execution. Multiple test files simultaneously importing the large renderer module graph were exceeding the default timeout during beforeAll hooks.
Changes:
- Increased
hookTimeoutconfiguration invitest.config.mtsto 30000ms (30 seconds) to accommodate parallel module initialization during test setup
| setupFiles: [path.resolve(__dirname, 'vitest.setup.ts')], | ||
| exclude: ['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**'], | ||
| passWithNoTests: true, | ||
| hookTimeout: 30000, // Increase hook timeout to 30s for complex module imports |
There was a problem hiding this comment.
While increasing the hookTimeout will resolve the immediate CI test failures, this is treating a symptom rather than the root cause. The real issue is that multiple test files are independently importing the entire renderers module tree in parallel, causing redundant module initialization.
A more optimal solution would be to move the renderer imports to vitest.setup.ts so they're loaded once globally before all tests run. This would:
- Eliminate the need for
beforeAllhooks in each test file - Remove the parallel module loading race condition
- Make tests start faster
- Prevent future timeout issues as the codebase grows
Consider adding this to vitest.setup.ts:
// Import renderers once for all tests
import '@object-ui/components/renderers';Then remove the beforeAll hooks from all test files. However, if you choose to keep the current approach for architectural reasons (e.g., to allow selective test running), the timeout increase is reasonable.
| hookTimeout: 30000, // Increase hook timeout to 30s for complex module imports |
CI tests were failing with "Hook timed out in 10000ms" during
beforeAllhooks that import the renderers module. When multiple test files run concurrently and all initialize the same large module graph, the default 10s timeout is insufficient.Changes
hookTimeoutto 30s invitest.config.mtsto accommodate parallel module initializationThe failing tests (
feedback-overlay-renderers,form-renderers,layout-data-renderers) all share the same import pattern:This import triggers registration of all component renderers across multiple submodules, which takes longer when multiple test files execute simultaneously.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.