Skip to content

Commit e2460c5

Browse files
authored
fix(hub): retry temp-dir cleanup on Windows to avoid EPERM (#408)
1 parent 80ec777 commit e2460c5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/hub/src/node/__tests__/host-terminals.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ describe.runIf(process.platform === 'win32')('devframeTerminalHost child-process
430430
}, 10_000)
431431
// The host holds the `cmd.exe` wrapper, not the node child.
432432
expect(session.getChildProcess()?.pid).not.toBe(pid)
433-
return { session, pid, cleanup: () => rmSync(dir, { recursive: true, force: true }) }
433+
// Windows releases the killed process's file handles asynchronously, so an
434+
// immediate `rm` can still hit EPERM; retry until the handles are gone.
435+
return { session, pid, cleanup: () => rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }) }
434436
}
435437

436438
it('terminate() kills the process started by a .cmd shim', async () => {

0 commit comments

Comments
 (0)