ci: Coverage job fails on a random package's test:coverage task and hides the failing test
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, typescript
调研方向
Start with .github/workflows/pr.yml lines 76 and 105 and inspect the Coverage job output settings. Reproduce coverage failures under CPU load in ai-harness and ai-react, using the listed vitest and Nx commands; use the failing test output to identify timing dependent tests. Done when failed task output identifies the test and the intermittent failures are fixed, with parallelism capped only if failures persist.
由索引模型根据 Issue 内容生成。
描述
TanStack AI version
main (8731d75)
Framework/Library version
CI only (.github/workflows/pr.yml, Coverage job)
Describe the bug and the steps to reproduce it
The PR Coverage job fails at random on PRs that change @tanstack/ai. No coverage metric drops. One package's test:coverage task fails, and it is a different package each time. A re-run passes.
Seen so far:
| Run | PR | Failed task |
|---|---|---|
| 40271697755 | #1894 | @tanstack/ai-harness:test:coverage (passed on re-run) |
| 40270604983 | #1887 | @tanstack/ai-harness:test:coverage |
| 40277024581 | #1894 | @tanstack/ai-react:test:coverage |
The same tests pass locally:
packages/ai-harness:vitest run, 2469 passed.packages/ai-react:vitest runandnx run @tanstack/ai-react:test:coverage --skip-nx-cache, 251 passed.
Likely cause: a change to @tanstack/ai makes the job measure about 76 packages, twice (PR head and merge-base). nx run-many runs them in parallel on one runner. Tests that depend on timing then time out under the load.
Second problem: the job log does not show the output of the failed task. pr.yml:76 and pr.yml:105 run nx run-many --outputStyle=static, and the log only has the Nx summary line ✖ @tanstack/ai-harness:test:coverage. So nobody can name the flaky test from CI.
Fix
- Make the Coverage job print the full output of a failed task, so the failing test name and error are in the job log.
- Find the timing-sensitive tests in
ai-harnessandai-react. To do this, run their coverage under CPU load locally, or use the log from step 1. Then fix them: remove real-time waits, use fake timers, or wait for events instead of a fixed time. - If step 2 does not remove all failures, cap the parallel tasks for the coverage step (
--parallel=N). Do not add retries that hide failures.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
CI runs listed above. No local reproduction yet.
Do you intend to try to help solve this bug with your own PR?
Yes, I am also opening a PR to fix this issue.
- 主要语言
- TypeScript
- 星标
- 3.2k
- 派生
- 372
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 244
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/ai 的其他 Issue
-
Durable resume through withPersistence never fills ctx.inputResponse for mcp_input interrupts可能已有人在做 @tombeckenham 于 3 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
ai, ai-persistence: a nested subagent that waits runs again from the start under withPersistence可能已有人在做 @tombeckenham 于 4 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
ai-ollama: streamed chat() reports finishReason "stop" when done_reason is "length"可能已有人在做 @AlemTuzlak 于 4 天前认领。 未关闭waiting-on: maintainer
维护者通常 1 天内回复
-
Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)可能已有人在做 @jherr 于 10 天前认领。 未关闭enhancement waiting-on: maintainer
维护者通常 1 天内回复
-
move to modelschemas可能已有人在做 @jherr 于 11 天前认领。 未关闭has-pr waiting-on: maintainer
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
Merit-Systems/x402scan#1312 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Native Web
难度 1/5 1 小时以内 新手友好度 80/100
digitalfabrik/integreat-app#4517 ·
维护者通常 2 天内回复
-
TLS guide repeats certs/ in the certificate directory可能已有人在做 @maheshrijal 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
prometheus/docs#3156 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
medusajs/dtc-starter#90 ·
维护者通常 1 天内回复