Skip to content

test(worktree): fix main CI red from #10106 (teardown + watch tests) - #10115

Merged
nwparker merged 1 commit into
mainfrom
fix/verify-ci-teardown-watch-tests
Jul 23, 2026
Merged

nwparker merged 1 commit into
mainfrom
fix/verify-ci-teardown-watch-tests

Conversation

@nwparker

@nwparker nwparker commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

main went red after #10106 ("verify exited PTYs before blocking deletion") merged — its verify job left two failing tests it didn't update. This isolates the fixes for both.

Fixes

  1. orca-runtime.test.ts → "does not start Git removal when physical PTY stop cannot be proven" — stale after fix(worktree): verify exited PTYs before blocking deletion #10106. The new killAllProcessesForWorktree tolerates a failed PTY stop when a fresh listProcesses inventory proves the PTY exited. The test's provider stub returned an empty inventory (= proven exited), so it resolved {} instead of rejecting. Fix keeps pty-1 live in the inventory so the exit genuinely can't be proven → it rejects as intended.
  2. worktree-git-common-watch.test.ts → "does not fabricate worktree deletions when the readdir fails non-ENOENT (transient)" — a test race exposed under CI load. Between await rm(worktreesDir) and await writeFile(worktreesDir), a poll tick could observe the dir as ENOENT (a legitimate "all removed" → emits a delete), defeating the non-ENOENT assertion. Swapped to synchronous rmSync/writeFileSync so no event-loop turn (and thus no poll tick) sees the transient ENOENT window.

Evidence

pnpm exec vitest run --config config/vitest.config.ts \
  src/main/runtime/orca-runtime.test.ts \
  src/main/ipc/worktree-git-common-watch.test.ts

Both pass locally.

Notes

  • Test-only changes; no production code touched.
  • Cross-platform: sync swap is node:fs, works on macOS/Linux/Windows.

Made with Orca 🐋

- orca-runtime: 'stop cannot be proven' now requires the fresh PTY inventory
  to still show the pty live (empty inventory proves exit post-#10106).
- git-common-watch: swap worktrees dir->file synchronously so no poll tick
  observes the transient ENOENT window and fabricates a delete.

Co-authored-by: Orca <[email protected]>
(cherry picked from commit e11736d7e170982eeebe09256eb549446a4f4f7b)
@nwparker
nwparker merged commit 0b34442 into main Jul 23, 2026
2 checks passed
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 64765c7b-bb4b-436a-974a-07bd9f5f1cac

📥 Commits

Reviewing files that changed from the base of the PR and between 5610142 and 30e5751.

📒 Files selected for processing (2)
  • src/main/ipc/worktree-git-common-watch.test.ts
  • src/main/runtime/orca-runtime.test.ts

📝 Walkthrough

Walkthrough

Updated two tests for deterministic behavior. The worktree polling test now uses synchronous filesystem operations when replacing the worktrees directory with a file. The PTY-removal test now returns an active PTY from the local provider after a failed stop, preserving the unprovable physical-stop scenario.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
stablyai#10115)

- orca-runtime: 'stop cannot be proven' now requires the fresh PTY inventory
  to still show the pty live (empty inventory proves exit post-stablyai#10106).
- git-common-watch: swap worktrees dir->file synchronously so no poll tick
  observes the transient ENOENT window and fabricates a delete.


(cherry picked from commit e11736d7e170982eeebe09256eb549446a4f4f7b)

Co-authored-by: Orca <[email protected]>
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