Skip to content

test(web): 129 模型合并用例显式超时,消除 provider-settings 的 CI 随机红 - #516

Open
Qiyuanqiii wants to merge 1 commit into
mainfrom
Qiyuanqiii/provider-settings-timeout
Open

Qiyuanqiii wants to merge 1 commit into
mainfrom
Qiyuanqiii/provider-settings-timeout

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

2026-10-29 本地全量跑(2873 项)时,provider-settings.test.tsx > refuses an over-limit model merge without silently truncating the draft or selection 报 Test timed out in 5000ms;同一提交单独复跑 3 次、6 路并行跑整文件、整包复跑都绿,属于负载相关的随机超时。

根因不是死循环或异步等待,而是 fixture 本身重:该用例要构造 128 个模型的列表,选中供应商后会把 128 条输出策略、128 个图片能力下拉全部渲染出来,再加一条待合并模型。隔离耗时约 1.0–1.5 秒,默认 testTimeout 只有 5000ms,CI 多 worker 争用时余量不够。试过把 userEvent 的 delay 设为 null,只省约 12%,说明主要成本在 129 行控件的渲染,不在事件模拟。

修法:只给这个用例显式 { timeout: 15000 },不抬高全局超时;注释说明 fixture 成本。产品代码与断言不变。

验证:

  • npx vitest run src/v2/components/provider-settings.test.tsx -t "refuses an over-limit model merge" --testTimeout=800:加显式超时前在 800ms 下超时(红),加后同一命令通过,证明 per-test timeout 覆盖全局生效。
  • 该文件 60/60;npx vitest run 287 files / 2873 tests 全绿;npm run typecheck、npm run build 通过。
  • OCR delegate:该文件被 default_path 排除,已人工过一遍,仅新增 options 参数与注释,无逻辑、无安全面变化。

边界:纯测试超时配置,无产品行为变化,因此没有做浏览器验收。不涉及协议、OpenAPI、surface、权限或依赖。

CI 结果以本 PR 运行结果为准。

The over-limit fixture renders 128 model policies plus image selectors
and runs around a second in isolation, so the 5s default left too little
headroom on a contended CI worker. Scope a 15s timeout to this case
instead of raising the global limit.
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.

2 participants