Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/src/__tests__/basic-renderers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
// Import renderers to ensure registration
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Comment on lines 18 to +20
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.

/**
* Comprehensive tests for basic renderer components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
// Import renderers to ensure registration
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports

/**
* Comprehensive tests for disclosure renderer components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
// Import renderers to ensure registration
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports

/**
* Comprehensive tests for feedback renderer components
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/__tests__/form-renderers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
// Import renderers to ensure registration
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Comment on lines 18 to +20
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.

/**
* Comprehensive tests for form renderer components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
// Import renderers to ensure registration
beforeAll(async () => {
await import('../renderers');
});
}, 30000); // Increase timeout to 30 seconds for heavy renderer imports
Comment on lines 17 to +19
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.

/**
* Comprehensive tests for layout renderer components
Expand Down
Loading