Repository navigation
test(output): make breakPath() fail the spawn on both PTY hosts - #2364
Conversation
breakPath() only broke the Node sidecar, by putting no node on PATH. The server picks the Rust PTY host by absolute path, so with a local build in crates/pty-sidecar/target/release the spawn still started and the two spawn-failure tests timed out. Node that install.sh puts under ~/.local/share/ovis is found through HOME, so it escaped as well. While the fixture is active, point OVIS_PTY_SIDECAR_BIN at a path that does not exist and HOME at an empty directory, and read nodeSidecarAvailable() first so a run on the Rust host does not cache Node as missing. Closes #2344
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Block both PTY host paths server/output.contract.test.ts, changelog.d/output-test-spawn-failure-rust-host.md |
The fixture checks Node sidecar availability, resolves the existing herdr executable, and configures environment values that prevent the Rust host and Node fallback from spawning. Cleanup restores or removes the changed values. The changelog records the test update. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- devswha/ovis#1859: Adds installed Rust PTY host selection, which the fixture now overrides.
- devswha/ovis#1785: Introduces Rust PTY host selection and Node fallback, both covered by the fixture.
- devswha/ovis#1908: Defines Rust and Node host selection and availability checks used by the fixture.
Suggested reviewers: yoonwoo-ha
Merge Risk: 
Minimal · up to 777f4
-
No merge-blocking risk is identified in this test-only change.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description is detailed and covers the problem, resulting behavior, issue reference, test-only scope, validation commands, environments, results, and review context. It uses “What” and “Verification” instead of the template’s “Change” and “Validation” headings, but the required information is present.
Full details: Linked Issues check
-
Explanation
Issue
#2344requires the test fixture to fail the PTY spawn when the Rust host exists locally. The diff setsOVIS_PTY_SIDECAR_BINto a nonexistent path, hides installer-provided Node with an emptyHOME, and keepsherdrresolved before restrictingPATH. This covers the Rust and Node fallback paths without production-code changes. The added changelog records the maintenance fix.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#2344. Theserver/output.contract.test.tschanges update only the spawn-failure fixture and its cleanup. The changelog entry documents that test fix. No unrelated production behavior or unrelated test behavior is changed.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- 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.
Comment @coderabbitai help to get the list of available commands.
|
Merging 777f4cd (closes #2344, thank you @kilhyeonjun for the report and the diagnosis). Test-only: the output contract tests for an attach that cannot spawn now break the spawn on both PTY hosts (the Rust host via a nonexistent OVIS_PTY_SIDECAR_BIN, the installer's Node via an empty HOME, besides PATH), restoring every variable afterwards and reading Node's availability first so a Rust-host run does not cache it as missing. Lane evidence: 12 pass / 2 fail before with a local Rust host and an installer Node, 14/14 after in 5 host setups; check fast green. The merge pass read the diff (one test helper + a changelog fragment). No behaviour change, so no CodeRabbit review was needed. |
Closes #2344
What
breakPath()inserver/output.contract.test.tsis the fixture that makes a terminal attach fail to spawn for two tests:a terminal attach that cannot spawn (#154) > reports the failure and leaves the pane attachable, never a record without a ptyan attach herdr refuses over a read in progress > ends the terminal, not the server, when a retried attach cannot spawnIt only broke the Node sidecar, by putting
PATH=/nonexistent. The server picks the Rust PTY host by absolute path (OVIS_PTY_SIDECAR_BIN, else the installedbin/, elsecrates/pty-sidecar/target/release), so with a local build the spawn still started and both tests timed out. It also missed the Node that install.sh puts under~/.local/share/ovis/node, whichrealNode()finds through HOME rather than PATH.While the fixture is active it now also:
OVIS_PTY_SIDECAR_BINat a path that does not exist, so the Rust host fails its check and the server falls back to Node;HOMEat an empty directory under the test's temp root, so the installer's Node is hidden too;nodeSidecarAvailable()before breaking anything, so a run on the Rust host does not cache Node as missing for the tests after it.Every variable is restored exactly: an unset one is deleted again. This is a test-only change; no production code changes.
Verification
All runs use
bun run check run bun test --timeout 15000 ./server/output.contract.test.tson this PC (Linux x64, herdr 0.9.5). The Rust host is a copy of the 0.4.18 release binary placed atcrates/pty-sidecar/target/release/ovis-pty-sidecar; there is no cargo here.OVIS_PTY_SIDECAR=rustwith the host present~/.local/share/ovis/node/bin/node, simulated with a temp HOME)bun run check fastpasses.Review
breakPath()now reads it first.os.homedir()does not followprocess.env.HOME, lazy lookups read HOME again on each call, and herdr stays on the check session's own socket.Notes
bun run check run, herdr is reached throughHERDR_SOCKET, so RPCs are unaffected. The empty directory is removed with the test's temp root.