test: pty bridge late-signal fallback chain; document unreachable error arms (L6)

- signal_after_child_exit_takes_both_kill_fallbacks: a late signal
  (after the child exited) takes kill(-pgid) fail -> kill(pid) fail ->
  warn + return, with no panic — the reachable part of the
  REQ-TTY-02 fallback chain.
- the remaining bridge error arms are documented-unreachable through
  the public path (per the review's disposition), with per-arm
  reasoning in the module doc: try_clone_reader (dup failure),
  reader read error (EIO -> EOF mapped), take_writer (second-take
  only), writer write/flush (externally-closed fd), waiter wait()
  (already-reaped child). The ADR-055 §4 -1 sentinel is covered at
  the adapter level (exit_error_sends_minus_one) — it also arises
  when the oneshot drops on kill-on-cancel.
- local/pty.rs line coverage 80.85% -> 86.01%; total 94.48%.
This commit is contained in:
2026-09-05 07:17:48 +00:00
parent 96692d3b6a
commit a73484203e
2 changed files with 77 additions and 4 deletions
+27 -4
View File
@@ -534,7 +534,7 @@ Highlights:
| M1 | negotiation-rejection frame unhandled | implement disambiguation read | medium | medium (wire-facing) | ✅ resolved |
| L1 | channels `input` ignored | decide drop-vs-pass-through | small | low | ✅ resolved (2026-09-05) |
| L3 | `open_via_channels` 0% covered | end-to-end channels consumer test | medium | low | ✅ resolved (2026-09-05) |
| L6 | pty bridge error paths untested | targeted error-path tests | medium | low | open |
| L6 | pty bridge error paths untested | targeted error-path tests | medium | low | ✅ resolved (2026-09-05) |
| N4 | sleep-based timing | readiness signals | small | low | open |
| N6 | MSRV unverified | CI MSRV job or bump | small | none | open |
@@ -627,16 +627,39 @@ data flow). The channels harness (`wire_client_and_server`) moved to
producer path (`register_openable` + `drive_session_pre_negotiated`
through alkcall's channels stack).
### Resolution (2026-09-05, L6 — pty bridge error paths)
Per the review's own disposition ("the `try_clone_reader`/`take_writer`
failure paths can be left as documented-unreachable if the publisher
agrees"), the bridge's error arms are now **documented-unreachable**
(module doc in `local/pty.rs` §"Bridge error paths"), with the
reasoning per arm: `try_clone_reader` needs a dup failure (exhausted
fd table — not deterministically forceable); a reader read error has
no trigger (EIO → EOF is mapped); `take_writer` only fails on a second
take (the bridge takes it once); a writer write/flush error requires
an externally-closed fd; the waiter `wait()` failure needs an
already-reaped child (the bridge never calls `try_wait`). The
ADR-055 §4 `-1` sentinel the review wanted tested is covered at the
adapter level (`exit_error_sends_minus_one` — the sentinel also arises
when the oneshot drops on kill-on-cancel, exercised by the
cancel-cleanup tests).
The reachable fallback chain *is* now tested:
`signal_after_child_exit_takes_both_kill_fallbacks` — a late signal
(after the child exited) takes `kill(-pgid)` fail → `kill(pid)` fail →
warn + return, with no panic. `local/pty.rs` line coverage
80.85% → 86.01%; the remaining uncovered lines are exactly the
documented-unreachable arms plus `StdinSink`'s in-flight-parking path
(a single write cannot fill the 64-slot channel).
### Remaining (open)
- **L6** — pty bridge error paths untested.
- **N4** — sleep-based timing in signal/cancel tests.
- **N6** — MSRV unverified.
### Recommended Order (remaining)
1. **L6** — pty bridge error paths; medium effort.
2. **N4 + N6** — test hardening and MSRV; defer until CI exists.
1. **N4 + N6** — test hardening and MSRV; defer until CI exists.
---