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
[quality] attach: generic kill-failure branch of the stale-watcher reap loop (#356) is never exercised #357
src/attach.ts (PR #356, commit 3cdd285) reaps stale rationguard watchers one PID at a time and handles two failure branches in the catch:
stderr matches /no such process/i → log("watcher <pid> already exited; nothing to kill")
any other kill failure → console.error("Warning: could not kill stale rationguard watcher <pid>; continuing")
Only the first branch is exercised (test/attach-orchestration.test.js "keeps attaching when a stale watcher PID vanished before kill"). The Warning: branch — e.g. EPERM when the PID now belongs to another user, or a PID that was recycled — never runs under any test.
Evidence
Unit/CLI suite: npm test @ 3cdd285 — 597 pass, attach.js 100.00% lines / 97.18% branches. lcov for test/attach-orchestration.test.js shows the whole catch block (dist/attach.js 352–359) at count 1, i.e. one entry — the ESRCH test — with V8 attributing that single count to both the if and else lines. The gate therefore reports line 357 as covered although it has never executed.
End-to-end: pluk's only suite is the subprocess-level test/*.test.js run (scripts/run-tests.mjs; .github/workflows/test.yml); there is no separate e2e suite or coverage artifact, so the same evidence applies to both.
No mutation-testing config (stryker.config.* etc.) in this repo, so nothing else would have caught an unasserted branch here.
Recommendation
Add a stub kill that refuses one PID with "Operation not permitted" and assert: the warning is printed, the remaining PID is still reaped, and rationguard still starts.
Activity