You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows CI: launcher test exits 1 from its own teardown after every assertion has passed #1987
The windows CI job fails after the launcher suite has printed every "passed" line it has, with no assertion having failed:
ocr launcher exit-code tests passed
ocr launcher signal policy tests passed
skipping POSIX signal relay cases on win32
Error: EBUSY: resource busy or locked, unlink 'C:\Users\RUNNER~1\AppData\Local\Temp\ocr-launcher-test-qtdBKt\node_modules\@alibaba-group\ocr-win32-x64\bin\opencodereview.exe'
at unlinkSync (node:fs:1948:11)
at _unlinkSync (node:internal/fs/rimraf:215:14)
at rimrafSync (node:internal/fs/rimraf:196:7)
createLauncherFixture copies the running node executable to the fixture binary path on Windows (fs.copyFileSync(process.execPath, binaryPath)), where POSIX gets a symlink. The cases then run it. Windows keeps an executable's image mapped for a short time after the process that ran it exits, so a removal straight afterwards can fail with EBUSY.
Two places remove that file, and either can meet the lock:
testSpawnFailure does fs.unlinkSync(fixture.binaryPath);
the finally does fs.rmSync(fixture.root, { recursive: true, force: true }).
force: true doesn't help here — it suppresses ENOENT, not EBUSY.
The stack above is from the finally, which means the real failure was the one in testSpawnFailure and the teardown error replaced it on the way out. So the message on screen is never the thing that actually went wrong.
Why it matters beyond the flake
A suite whose assertions all pass can still exit 1, and when something does genuinely fail the error you get is the cleanup's. Both make the Windows job hard to trust.
Suggested fix
Retry both removals — fs.rm retries exactly EBUSY/EPERM when maxRetries is set, though it ignores the retry options unless recursive is also set, even for a single file. And let teardown report rather than decide: a temp directory that will not delete is not a reason to fail a build, and should never replace the run's own error.
@abhisheksharma2411 Thanks for opening this issue! I had just run into the same problem while looking into the Windows CI failure on #1909 and was about to open an issue myself. You beat me to it, haha! Thanks for putting together a fix in #1988 as well.
Activity
lizhengfeng101 commentedon Nov 18, 2026
@abhisheksharma2411 Thanks for opening this issue! I had just run into the same problem while looking into the Windows CI failure on #1909 and was about to open an issue myself. You beat me to it, haha! Thanks for putting together a fix in #1988 as well.