Skip to content

fix(tooling): test runs clean up temporary module files - #21603

Closed
Lenoridev wants to merge 1 commit into
pingdotgg:mainfrom
Lenoridev:t3/fix-open-issue
Closed

Lenoridev wants to merge 1 commit into
pingdotgg:mainfrom
Lenoridev:t3/fix-open-issue

Conversation

@Lenoridev

@Lenoridev Lenoridev commented Oct 19, 2026 •

Copy link
Copy Markdown

Problem

Successful test runs leave Vitest's temporary module copies on disk. Even a single contract test file leaves an ssr/ directory after the runner exits, so repeated local and agent test runs accumulate files.

Closes #20128.

Change

Update the paired vite-plus and @voidzero-dev/vite-plus-core catalog entries from 1.0.0 to 1.2.0. This brings in Vitest 5.0.4, which includes the upstream root-temp-directory cleanup fix in vitest-dev/vitest#11248. Match @vitest/browser-playwright to 5.0.4, as required by Vite+'s peer dependency, and regenerate the lockfile.

Scope and approval

The maintainer triage confirms the leak and requests these paired 1.2.0 catalog updates. The three version pins and their generated lockfile implement that direction. I found no open implementation for this issue before starting or before submitting.

Verification

Linux x64, Node 24.13.1, pnpm 11.10.0. The baseline reproduction used 1451e7cb23. All focused checks below were rerun at 2c029f7263, rebased onto main at cb0553ea39; the lockfile was regenerated from that main revision to retain its Markdown dependencies and patches. Each cleanup check used a fresh private TMPDIR:

test_temp_dir=$(mktemp -d)
TMPDIR="$test_temp_dir" vp test run --pool=forks packages/contracts/src/keybindings.test.ts
find "$test_temp_dir" -type f

Both runs passed all 11 tests. Before the update, Vitest 5.0.1 left five transformed-module files totaling 107,848 bytes, in addition to node-compile-cache. After the update, Vitest 5.0.4 left only node-compile-cache; no transformed-module directory remained.

The first cleanup attempt during rebase verification failed before running tests with ENOTEMPTY on node_modules/.vitest-cache while the other Vitest commands ran in parallel. Rerunning the cleanup command on its own passed all 11 tests and left only node-compile-cache.

Additional focused checks:

  • apps/server: vp test run src/keybindings.test.ts — 25 passed, including the patched @effect/vitest integration.

  • apps/web: vp test run --project unit src/keybindings.test.ts — 145 passed using the web Vite config.

  • apps/desktop: vp test run src/window/QuitHold.test.ts — 31 passed.

  • pnpm install --frozen-lockfile --prefer-offline --yes — passed, including repository preparation.

  • vp fmt --check pnpm-workspace.yaml apps/web/package.json, vp lint --report-unused-disable-directives vite.config.ts apps/web/vite.config.ts, and git diff --check — passed.

  • vp run --filter @t3tools/web typecheck — passed, including the Vite config and browser-test provider types.

Not checked: browser automation, production builds, macOS or Windows. No UI changes or screenshots apply. Repo-wide checks were left to CI.

Implemented and verified with GPT-6.1 Sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 19, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at dd29536

Macroscope's review found this PR approvable — This is a focused Vite Plus/Vitest tooling upgrade that addresses temporary test-module cleanup; the large lockfile change is generated dependency resolution rather than new application logic. It does not change product defaults, production code, or static-analysis suppressions.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae05e8d3-f901-4718-9273-3ee1050c3ce8
📥 Commits

Reviewing files that changed from the base of the PR and between dd29536 and 2c029f7.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing: 1
  • apps/web/package.json
🚧 Files skipped from review as they are similar to previous changes: 1
  • apps/web/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The workspace catalog updates vite and vite-plus to version 1.2.0. The web app updates @vitest/browser-playwright to version 5.0.4.

Changes: Test tooling version updates

Layer / File(s) Summary
Update test tooling versions
pnpm-workspace.yaml, apps/web/package.json
The catalog updates vite and vite-plus from 1.0.0 to 1.2.0. The web app updates @vitest/browser-playwright from 5.0.1 to 5.0.4.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 2c029

The updated test-tooling dependencies resolve compatibly. No identified issue prevents merging after normal checks.

### Architecture Summary

Architecture risk: 🔵 Low · up to dd295

The change affects 2 systems.

Changed systems: apps/web, pnpm-workspace.yaml

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — apps/web (ui) was modified; 1 changed file maps to changed impact.
  • observed — pnpm-workspace.yaml (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in apps/web/package.json: Updated the @vitest/browser-playwright dev dependency version from 5.0.1 to 5.0.4.
  • observed — Modified behavior in pnpm-workspace.yaml: The catalog upgrades the vite alias and vite-plus from version 1.0.0 to 1.2.0.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: cleaning up temporary module files after test runs.
Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It documents the issue, implementation, focused test results, limitations, and agent usage.
Linked Issues check Passed Issue #20128 requires test runs to remove temporary transformed-module files and permits only reusable node-compile-cache. The PR updates vite-plus and the @voidzero-dev/vite-plus-core alias fro…
Out of Scope Changes check Passed The reviewable changes are limited to the two catalog version updates and the matching @vitest/browser-playwright update. Each change supports the dependency fix for issue #20128. No unrelated chang…
Full details: Linked Issues check

Explanation

Issue #20128 requires test runs to remove temporary transformed-module files and permits only reusable node-compile-cache. The PR updates vite-plus and the @voidzero-dev/vite-plus-core alias from 1.0.0 to 1.2.0, and updates @vitest/browser-playwright to 5.0.4. The reported fresh-TMPDIR test run passed 11 tests and left only node-compile-cache. The excluded lockfile cannot be inspected, but the reported frozen-lockfile installation passed.

Full details: Out of Scope Changes check

Explanation

The reviewable changes are limited to the two catalog version updates and the matching @vitest/browser-playwright update. Each change supports the dependency fix for issue #20128. No unrelated change is shown. The excluded pnpm-lock.yaml does not provide evidence of an out-of-scope change.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Lenoridev

Copy link
Copy Markdown
Author

Closing as superseded by merged #22716, commit a1dc856ee6. Main now uses Vite+ and vite-plus-core 1.3.0, Vitest 5.0.5, and the matching Playwright adapter. These versions include the temporary-module cleanup fix, so this PR's 1.2.0 pins are redundant.

The original reproduction and before/after cleanup evidence remain in this PR's description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Every test run leaves a temp folder behind (vitest 5.0.1 via vite-plus 1.0.0)

1 participant