Skip to content

Fix flaky test timeout in ObjectForm MSW test - #357

Merged
hotlong merged 2 commits into
mainfrom
copilot/update-action-workflow-settings
Feb 2, 2026
Merged

Fix flaky test timeout in ObjectForm MSW test#357
hotlong merged 2 commits into
mainfrom
copilot/update-action-workflow-settings

Conversation

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Fixes a flaky test in @object-ui/plugin-form that was failing intermittently in CI environments due to insufficient timeout for asynchronous operations.

Problem

The test "loads schema and renders form fields" in ObjectForm.msw.test.tsx was timing out in CI environments. The test was using the default 1000ms timeout for waitFor(), which was insufficient when network mocks took longer to respond in CI environments. Meanwhile, the second test "loads record data in edit mode" explicitly specified a 2000ms timeout and passed consistently.

Solution

Added explicit { timeout: 2000 } parameter to the first test's waitFor() call to match the second test, ensuring consistent behavior across local and CI environments.

Changes Made

  • Added timeout parameter to waitFor() in the first test of ObjectForm.msw.test.tsx
  • Added comment explaining the timeout is needed for network mock buffer time

Testing

  • ✅ All tests in @object-ui/plugin-form pass locally
  • ✅ Code review completed - no issues found
  • ✅ CodeQL security check - no vulnerabilities detected
  • ✅ Both MSW tests now have consistent timeout configuration

The fix is minimal and surgical, changing only the test configuration without altering any production code or functionality.

Original prompt

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


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

@vercel

vercel Bot commented Feb 2, 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 2, 2026 2:35pm
objectui-components Ready Ready Preview, Comment Feb 2, 2026 2:35pm
objectui-crm-app Error Error Feb 2, 2026 2:35pm

Request Review

Added explicit timeout parameter to waitFor() call in first test to match the second test. This ensures the test has sufficient time to complete in CI environments.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@copilot 继续

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 继续

已完成所有检查步骤 (All review steps completed):

✅ Code review - No issues found
✅ CodeQL security check - No vulnerabilities detected
✅ All tests passing locally

修复已提交在 f4b2304 - 为第一个测试添加了明确的 2000ms 超时,确保在 CI 环境中有足够的时间完成网络模拟请求。

Copilot AI changed the title [WIP] Update action workflow settings for better performance Fix flaky test timeout in ObjectForm MSW test Feb 2, 2026
Copilot AI requested a review from xuyushun441-sys February 2, 2026 14:57
@xuyushun441-sys
xuyushun441-sys marked this pull request as ready for review February 2, 2026 15:00
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1766.11KB 417.46KB
core (index.js) 0.63KB 0.30KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 16.99KB 4.48KB
fields (index.js) 87.09KB 17.11KB
layout (index.js) 12.79KB 3.96KB
plugin-aggrid (AgGridImpl-BQ6tBvrq.js) 5.27KB 1.92KB
plugin-aggrid (ObjectAgGridImpl-CGFeGvOH.js) 11.44KB 3.52KB
plugin-aggrid (index-CLKYMco3.js) 19.20KB 4.89KB
plugin-aggrid (index.js) 0.22KB 0.16KB
plugin-calendar (index.js) 33.29KB 8.32KB
plugin-charts (AdvancedChartImpl-DQ5nNx27.js) 69.51KB 16.23KB
plugin-charts (BarChart-DTT3mpbI.js) 535.74KB 134.11KB
plugin-charts (ChartImpl-DkYg9drc.js) 8.78KB 3.11KB
plugin-charts (index-G7dGOmyT.js) 12.68KB 3.91KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.39KB 5.22KB
plugin-dashboard (index.js) 11.99KB 3.82KB
plugin-editor (MonacoImpl-hfdmoz6k.js) 18.15KB 5.59KB
plugin-editor (index-CuYbY6xb.js) 10.10KB 3.32KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-form (index.js) 15.22KB 4.91KB
plugin-gantt (index.js) 18.13KB 5.29KB
plugin-grid (index.js) 40.64KB 11.25KB
plugin-kanban (KanbanImpl-aWuAfqMD.js) 76.50KB 20.46KB
plugin-kanban (index-CMlW1e7P.js) 11.89KB 3.68KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-map (index.js) 16.78KB 5.12KB
plugin-markdown (MarkdownImpl-DufQ-eRU.js) 256.68KB 64.45KB
plugin-markdown (index-CrmE78vF.js) 9.63KB 3.17KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-timeline (index.js) 25.86KB 6.70KB
plugin-view (index.js) 16.69KB 4.93KB
react (LazyPluginLoader.js) 1.10KB 0.58KB
react (SchemaRenderer.js) 3.02KB 1.21KB
react (index.js) 0.39KB 0.25KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 0.20KB 0.18KB
types (views.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@hotlong
hotlong merged commit 1d8cabf into main Feb 2, 2026
13 of 15 checks passed
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

✅ All checks passed!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants