Skip to content

test(orcad): retry launcher-isolation teardown when Windows holds node.exe (EBUSY) - #28061

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-launcher-isolation-ebusy
Oct 12, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-launcher-isolation-ebusy

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 0 0 0 0

ELI5

The hourly macOS dev build on main went red. Its Windows ARM test job passed all 1060 tests, then failed while deleting its temporary folder: Windows briefly keeps a just-exited node.exe locked. The cleanup now retries for a moment instead of failing right away.

What Changed

Problem. Hourly macOS Dev Build run 38295856465 (main at 8a7d19e3300) failed in orcad-template / persistence (windows-11-arm). Every test in src/main/orcad/orcad-launcher-isolation.integration.test.ts passed. The file was then marked failed because its afterAll cleanup threw:

Error: EBUSY: resource busy or locked, unlink '...\orca-launcher-isolation-OY4A4b\tampered\runtimes\node-<hash>\node.exe'

The "refuses changed server bytes" test runs a copied node.exe from that folder. runProcess waits for the process to exit, but Windows can keep the executable's file locked for a short time after that (for example, while antivirus scans it). The rm right afterwards loses that race now and then.

Fix. The cleanup calls rm(root, { recursive: true, force: true, maxRetries: 8, retryDelay: 100 }). Node retries EBUSY/EPERM for up to about a second before giving up. Other temp-directory teardowns in this repo use the same options, for example local-worktree-removal-recovery-live.test.ts and fish-xdg-data-dirs-handoff.test.ts.

User-facing change: none. This only changes test cleanup.

Why

Retrying the delete is the existing fix for this Windows lock in the repo. The other options were to wait a fixed time after the process exits, which is slower and still a guess, or to stop cleaning up, which leaves temp folders behind on CI runners.

Another part of main's red CI, the check:main-sync-spawn-ratchet crash that fails static analysis on every PR, is already fixed in #28054 and #28053, so it isn't repeated here.

Linked Issue

N/A (main CI flake)

Visual Proof

N/A: test-only change, nothing visible changes.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • pnpm test src/main/orcad/orcad-launcher-isolation.integration.test.ts passes on macOS. The tests that need the bundled Node runtime skip there, so the Windows race itself isn't reproduced locally. The windows-11-arm job covers it.

  • orca-ci-checks: lint, code quality, localization and pnpm run typecheck pass. The native lint audit and the sync-spawn ratchet fail on current main until fix(ci): point the main sync-spawn ratchet at the shared ratchet library #28054 lands; they don't involve this file.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48c08fa1-0e0e-466a-bedf-fd8a91ab6bd0

📥 Commits

Reviewing files that changed from the base of the PR and between 61d4c89d499220913c4c0bb516de65cfd7e278f3 and 3403501.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2956326-db46-458e-8e62-2df741ed7329

📥 Commits

Reviewing files that changed from the base of the PR and between 9fcbb2c and 61d4c89d499220913c4c0bb516de65cfd7e278f3.


📒 Files selected for processing (1)
  • src/main/orcad/orcad-launcher-isolation.integration.test.ts

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



📝 Walkthrough
📝 Walkthrough

Walkthrough

The integration test cleanup now retries forced recursive removal of its temporary directory up to eight times, with a 100 ms delay between retries.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 61d4c

This change only adds retries to integration-test cleanup. No concrete merge-blocking risk is established, so it is ready to merge subject to normal checks.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the test-only change and the Windows EBUSY teardown issue it addresses.
Description check Passed The description is detailed and covers the problem, change, rationale, testing, scope, visual proof, and checklist. It marks the linked issue as N/A and leaves some review or full-suite validation det…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

An exited node.exe copy can stay locked for a moment on Windows, so the
afterAll rm failed the hourly build's windows-11-arm persistence job.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-launcher-isolation-ebusy branch from 61d4c89 to 3403501 Compare October 12, 2026 20:40
@brennanb2025
brennanb2025 merged commit 8e8c087 into main Oct 12, 2026
48 of 49 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