You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows CI: providerInterfaceRoutes 全目录路由审计触发5秒超时 #7852
各供应商预设导入后的路由与 API 契约断言均正常,此问题属于全目录路由审计用例在单用例超时预算下的结构性累加问题。providerInterfaceRoutes.test.ts 中的 keeps every preset HTTP API consistent with the actual route after import 用例在单一 it() 内同步遍历全部 BUNDLED_CATALOG.presets 并执行完整的 buildUserProvider 解析与元数据展开;随着内置预设与模型数量增长,在 GitHub Actions Windows runner 单 worker 负载下累积耗时达到临界点(实测 5033ms,触发 Vitest 默认 5000ms 限制),而 macOS 本地单独执行约 658ms。
行动
首要步骤(建议负责角色:@cindy/model-providers 维护者 / 单测作者):
将 packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts:86 的单体 for 循环重构为参数化测试 it.each(BUNDLED_CATALOG.presets ?? [])(例如 it.each(BUNDLED_CATALOG.presets ?? [])('keeps $id preset HTTP API consistent with the actual route after import', preset => { ... }))。
Activity
dash-s-cindy commentedon Oct 29, 2026
判断
各供应商预设导入后的路由与 API 契约断言均正常,此问题属于全目录路由审计用例在单用例超时预算下的结构性累加问题。
providerInterfaceRoutes.test.ts中的keeps every preset HTTP API consistent with the actual route after import用例在单一it()内同步遍历全部BUNDLED_CATALOG.presets并执行完整的buildUserProvider解析与元数据展开;随着内置预设与模型数量增长,在 GitHub Actions Windows runner 单 worker 负载下累积耗时达到临界点(实测 5033ms,触发 Vitest 默认 5000ms 限制),而 macOS 本地单独执行约 658ms。行动
packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts:86的单体for循环重构为参数化测试it.each(BUNDLED_CATALOG.presets ?? [])(例如it.each(BUNDLED_CATALOG.presets ?? [])('keeps $id preset HTTP API consistent with the actual route after import', preset => { ... }))。buildUserProvider参数、模型遍历与expect(actual, ...).toBe(expected)校验逻辑完全不变。pnpm --filter @cindy/model-providers test及 Windows unit tests (1/4) 分片全绿无超时。manager.test.ts)补齐平台补偿vi.setConfig({ testTimeout: process.platform === 'win32' ? 15_000 : 5_000 })。关键依据
Test timed out in 5000ms,未发生断言不一致报错。it.each;将全目录审计参数化不仅彻底分散单用例预算压力,也能在未来某预设路由损坏时直接在测试结果树中精准标出出错预设 ID。相关记录