Skip to content

fix: Windows build — wait for the sidecar to exit before removing its temp dir (v0.2.134) - #6

Merged
raylanlin merged 1 commit into
masterfrom
claude/gracious-davinci-j7qso7
Oct 2, 2026
Merged

raylanlin merged 1 commit into
masterfrom
claude/gracious-davinci-j7qso7

Conversation

@raylanlin

@raylanlin raylanlin commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What broke

Build Windows Installer run 36976756947 stopped in npm test. Of 202 tests, 201 passed. The failure was in the after hook of tests/sidecar-client.test.mjs:

EBUSY: resource busy or locked, rmdir 'C:\Users\RUNNER~1\AppData\Local\Temp\mw-sidecar-60rVgZ'

On Windows, ChildProcess.kill() returns before the Python sidecar has actually exited. Windows also refuses to delete a folder that a live process is using as its working directory. The hook deleted that folder right after stop(), so it hit EBUSY.

Ubuntu CI (ci.yml) cannot catch this because Linux allows the delete. Earlier Windows runs passed only because the process happened to exit in time.

Fix (test only, app code unchanged)

  • The hook now waits for the sidecar process's exit event before cleaning up, with a 5 s cap.
  • rmSync now uses maxRetries: 10, retryDelay: 200.
  • If the temp folder still can't be deleted, the hook logs a warning instead of failing the test.

Checks

  • npm run lint and npm run typecheck are clean.
  • npm test passes all 201 tests, and no mw-sidecar-* folders are left behind.
  • precommit-check.sh 0.2.134 passes.
  • Build Windows Installer has been started on this branch to confirm the fix on Windows.

… on the Windows build)

On Windows kill() returns before the process is gone and a live process's
working directory cannot be removed, so the sidecar-client test's cleanup
failed with EBUSY and stopped the installer build. Wait for the exit, retry
the delete, and only warn if a temp dir is left behind. App code unchanged.
@raylanlin
raylanlin merged commit 0e7f9b5 into master Oct 2, 2026
2 checks passed
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.

1 participant