🐛 修复 async_queue 压力测试在 CI 争抢下的超时误报 - #1600
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist / 检查清单
Description / 描述
问题:
test.yaml工作流(run 80078796006)在Run testsjob 中失败:该用例串行
await3000 个堆叠任务并附带递归链,vitest.config.ts中 "fast" project 的全局testTimeout为 340ms(针对普通用例的紧凑预算)。本地单测与全量覆盖率运行(--coverage)均稳定通过(约 87–88ms),说明并非逻辑缺陷,而是该用例本身真实耗时较高(约 300ms 级),
在 CI 共享 runner 的并发 worker 争抢下偶发超出预算,属于超时误报。
方案:比照仓库中
encoding.test.ts对同类重量级用例(chardet 32KB 采样,同样逼近340ms 预算)已采用的做法,仅为该用例通过
it.sequential(name, { timeout: 850 }, fn)显式给出 850ms 单测预算,不放宽影响其余全部用例的全局超时。
验证:
pnpm exec vitest run src/pkg/utils/async_queue.test.ts --project fast— 7/7 通过,该用例 87ms。pnpm exec vitest run --project fast --coverage— 126 files / 2092 tests 全部通过。Screenshots / 截图
不适用(纯测试配置调整,无 UI 变更)。