Skip to content

Fix test timeouts in @object-ui/components beforeAll hooks#313

Merged
hotlong merged 3 commits intomainfrom
copilot/fix-action-run-issues-another-one
Feb 1, 2026
Merged

Fix test timeouts in @object-ui/components beforeAll hooks#313
hotlong merged 3 commits intomainfrom
copilot/fix-action-run-issues-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 1, 2026

Three test files timing out at 10s when importing ../renderers in beforeAll hooks. The import loads ~50 Radix UI components synchronously.

Changes

Increased beforeAll timeout to 30s in files importing renderers:

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

Files modified:

  • feedback-overlay-renderers.test.tsx (was failing)
  • form-renderers.test.tsx (was failing)
  • layout-data-renderers.test.tsx (was failing)
  • basic-renderers.test.tsx (preventive)
  • complex-disclosure-renderers.test.tsx (preventive)

All 156 tests now complete within timeout in CI environments.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21555370237/job/62110572489#step:8:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 1, 2026

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 3:32am
objectui-components Ready Ready Preview, Comment Feb 1, 2026 3:32am
objectui-crm-app Ready Ready Preview, Comment Feb 1, 2026 3:32am

Request Review

Copilot AI and others added 2 commits February 1, 2026 03:02
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues in action run execution Fix test timeouts in @object-ui/components beforeAll hooks Feb 1, 2026
Copilot AI requested a review from hotlong February 1, 2026 03:05
@hotlong hotlong marked this pull request as ready for review February 1, 2026 03:32
Copilot AI review requested due to automatic review settings February 1, 2026 03:32
@hotlong hotlong merged commit b8b1930 into main Feb 1, 2026
6 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes test timeout failures in the @object-ui/components package by increasing the beforeAll hook timeout from the default (5-10 seconds) to 30 seconds for tests that import the renderer registry.

Changes:

  • Increased beforeAll timeout to 30 seconds in 5 test files that load ~80 Radix UI component renderers synchronously
  • Added explanatory comments documenting the reason for the increased timeout
  • Ensures all 156 tests complete successfully in CI environments

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/components/src/tests/layout-data-renderers.test.tsx Added 30s timeout to beforeAll hook importing renderers
packages/components/src/tests/form-renderers.test.tsx Added 30s timeout to beforeAll hook importing renderers
packages/components/src/tests/feedback-overlay-renderers.test.tsx Added 30s timeout to beforeAll hook importing renderers
packages/components/src/tests/complex-disclosure-renderers.test.tsx Added 30s timeout to beforeAll hook importing renderers
packages/components/src/tests/basic-renderers.test.tsx Added 30s timeout to beforeAll hook importing renderers (preventive)

Comment on lines 17 to +19
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The 30-second timeout is a pragmatic fix for CI environments, but consider investigating the root cause of slow imports. Loading ~80 renderer components in a beforeAll hook shouldn't take 10+ seconds unless there are:

  1. Circular dependencies causing multiple re-evaluations
  2. Heavy synchronous operations during module initialization
  3. Large dependency trees being loaded

Consider profiling the import with NODE_OPTIONS='--inspect-brk' vitest to identify bottlenecks. If this is purely a CI resource constraint issue, the timeout is reasonable. However, if there's a performance issue in the module loading chain, it should be addressed to improve developer experience in local testing as well.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to +20
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Consider adding a global testTimeout configuration in vitest.config.mts instead of setting timeouts individually in each test file. This would provide a consistent baseline for all tests and make it easier to adjust if needed:

test: {
  globals: true,
  testTimeout: 30000, // 30 seconds for heavy imports
  hookTimeout: 30000, // Also increase hook timeout
  // ... rest of config
}

This approach is more maintainable than duplicating the timeout value across multiple test files.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to +20
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Per coding guideline Rule #2 (Documentation Driven Development), this change should be documented. Consider updating packages/components/src/__tests__/README.md to explain:

  1. Why the 30-second timeout is needed for beforeAll hooks that import renderers
  2. The performance implications of loading ~80 renderer components
  3. Any plans to optimize this in the future

This helps future contributors understand the architecture decision and avoid confusion when seeing the timeout.

Copilot generated this review using guidance from repository custom instructions.
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.

3 participants