Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix: increase vitest hook timeout for parallel test imports - #317

Merged
hotlong merged 2 commits into
dependabot/npm_and_yarn/multi-b251156d90from
copilot/update-build-settings
Feb 1, 2026
Merged

hotlong merged 2 commits into
dependabot/npm_and_yarn/multi-b251156d90from
copilot/update-build-settings

Conversation

Copilot AI commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

CI tests were failing with "Hook timed out in 10000ms" during beforeAll hooks 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

  • Increased hookTimeout to 30s in vitest.config.mts to accommodate parallel module initialization

The failing tests (feedback-overlay-renderers, form-renderers, layout-data-renderers) all share the same import pattern:

beforeAll(async () => {
  await import('../renderers');
});

This import triggers registration of all component renderers across multiple submodules, which takes longer when multiple test files execute simultaneously.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21542544467/job/62079189230


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Feb 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 1, 2026 1:36pm
objectui-components Ready Ready Preview, Comment Feb 1, 2026 1:36pm
objectui-crm-app Ready Ready Preview, Comment Feb 1, 2026 1:36pm

Request Review

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>
Copilot AI changed the title [WIP] Update build settings for continuous integration fix: increase vitest hook timeout for parallel test imports Feb 1, 2026
Copilot AI requested a review from hotlong February 1, 2026 13:20
@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong
hotlong marked this pull request as ready for review February 1, 2026 13:27
Copilot AI review requested due to automatic review settings February 1, 2026 13:27
@hotlong
hotlong merged commit 22b0cab into dependabot/npm_and_yarn/multi-b251156d90 Feb 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hookTimeout configuration in vitest.config.mts to 30000ms (30 seconds) to accommodate parallel module initialization during test setup

Comment thread vitest.config.mts
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

Copilot AI Feb 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Eliminate the need for beforeAll hooks in each test file
  2. Remove the parallel module loading race condition
  3. Make tests start faster
  4. 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.

Suggested change
hookTimeout: 30000, // Increase hook timeout to 30s for complex module imports

Copilot uses AI. Check for mistakes.

This branch was successfully deployed

3 active deployments
Preview – objectui-crm-app — 9c0f225c Deployed Feb 1, 2026 by vercel[bot]
Preview – objectui — 9c0f225c Deployed Feb 1, 2026 by vercel[bot]
Preview – objectui-components — 9c0f225c Deployed Feb 1, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants