[Bug]: Every test run leaves a temp folder behind (vitest 5.0.1 via vite-plus 1.0.0)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- build-system, testing
调研方向
修复方法是提升 pnpm catalog 中 vite-plus 和 vite(@voidzero-dev/vite-plus-core)条目的版本号,issue 中说它们被固定在 1.0.0。将 TMPDIR 设置为一个空目录,在 packages/contracts 中运行 pnpm run test,然后用 ls -A 检查是否还残留 <id>/ssr 文件夹。测试仍然通过且只剩下 node-compile-cache 时即完成。
由索引模型根据 Issue 内容生成。
描述
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Build, CI, or release tooling
Steps to reproduce
On a clean checkout of main:
pnpm install
T=$(mktemp -d)
cd packages/contracts && TMPDIR=$T pnpm run test
ls -A "$T"
Expected behavior
A finished test run leaves nothing behind in the temp dir. The exception is node-compile-cache, which is reused across runs.
Actual behavior
Every run leaves a <tmpdir>/<21-char id>/ssr/ folder of transformed module copies, even when every test passes. For packages/contracts that's 109 files and 4.4 MB. apps/server runs leave up to ~34 MB each.
Cause: the catalog pins vite-plus 1.0.0, which pins vitest 5.0.1. In Vitest 5.0.0–5.0.2, Vitest.close() never removes the root _tmpDir that holds the forks pool's module copies. Vitest fixed this in 5.0.3: "Remove root temp dir on close" (vitest-dev/vitest#11248). vite-plus 1.1.0 ships vitest 5.0.3, and 1.2.0 ships 5.0.4.
Agents run tests in worktrees all day, so the folders pile up. On one machine, 411 of them (11.8 GB, uncompressed) came from t3code worktrees in under 3 days.
Suggested fix: bump the vite-plus and vite (@voidzero-dev/vite-plus-core) catalog entries to 1.2.0. I made the same bump in another repo on vite-plus 1.0.0: its 710 tests still passed and the run left no folder behind.
Impact
Minor bug or occasional failure
Version or commit
main @ e74f477eed
Environment
CachyOS Linux (kernel 7.2.10), Node 26.11.1, pnpm 11.10.0, vite-plus 1.0.0, vitest 5.0.1
Logs or stack traces
$ cd packages/contracts && TMPDIR=$T pnpm run test
RUN v5.0.1 …/packages/contracts
Test Files 39 passed (39)
Tests 667 passed (667)
$ ls -A "$T"
NEcLqKcMrzjuO4WeCz9m7
node-compile-cache
$ ls "$T/NEcLqKcMrzjuO4WeCz9m7"
ssr
$ ls "$T/NEcLqKcMrzjuO4WeCz9m7/ssr" | wc -l
109
Workaround
Delete stale <id>/ssr folders from the temp dir by hand, or override vitest to 5.0.3 or later.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 6 小时 53 分钟
- 30 天内合并 PR
- 222
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
[Bug]: T3_CODE_ORCHESTRATION_INSTRUCTIONS has no carve-out for user- or repo-mandated CLI review workflows (unlike T3_CODE_BROWSER_TOOL_INSTRUCTIONS)可能已有人在做 @nivethass15102007-tech 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
pingdotgg/t3code#19908 · 1 条评论 ·
维护者通常 1 天内回复
-
accepted bug via-triage
难度 2/5 1-3 小时 新手友好度 70/100
pingdotgg/t3code#19536 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
[Bug]: Diff panel hides the current branch name and the arrow overlaps the base ref when the panel is narrow可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭accepted bug via-triage
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#19048 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug] Windows repository cloning fails while creating an existing drive root可能已有人在做 @pujitha24 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 75/100
siyuan-note/siyuan#20629 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Volume eject does not refuse system, root or /home mounts可能已有人在做 @bernardopg 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
spacedriveapp/spacedrive#3159 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
melgarafael/DeskcommCRM#3000 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#639 ·
维护者通常 1 天内回复