Skip to content

fix(hub): retry temp-dir cleanup on Windows to avoid EPERM - #408

Merged
antfu merged 1 commit into
mainfrom
fix/windows-terminals-cleanup-eperm
Sep 25, 2026
Merged

antfu merged 1 commit into
mainfrom
fix/windows-terminals-cleanup-eperm

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Why

The windows-latest, node 26 unit-test job fails intermittently in packages/hub/src/node/__tests__/host-terminals.test.ts:

Error: EPERM, Permission denied: 'C:\Users\RUNNER~1\AppData\Local\Temp\devframe-terminals-shim-...'
 ❯ cleanup src/node/__tests__/host-terminals.test.ts:433

The Windows-only child-process-tree tests kill the shimmed process and then immediately remove its temp dir. Windows releases the killed process's file handles asynchronously, so the rm can race the OS and hit EPERM before the handles are gone.

What

Give the cleanup rmSync a bounded retry (maxRetries: 10, retryDelay: 100). Node retries specifically on EPERM/EBUSY/etc. for recursive removals, which lets the handles drain instead of failing the run.

This changes test cleanup only; no runtime behaviour changes.

This PR was created with the help of an agent.

@coldtea-pr-lens

Copy link
Copy Markdown

◈ PR Lens

Note

Only tests changed, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
devframe Skipped Skipped Sep 25, 2026 2:04am UTC

@antfu
antfu merged commit e2460c5 into main Sep 25, 2026
13 checks passed
@antfu
antfu deleted the fix/windows-terminals-cleanup-eperm branch September 25, 2026 02:25

This branch was previously deployed

1 inactive deployment
Preview — 4c46b5aa Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants