test(daemon-client): a restart probe that fails outright near the RPC deadline reports the daemon unavailable

Merged
TH
2mo ago
+59-0

Summary

A restart health probe that fails outright (503, closed connection, refused connection) with a small remaining RPC budget must report 'Remote daemon is unavailable' with daemonBaseUrl, never daemon_transport_timeout. #3056 tested only the timeout direction.

Follow-up to #3056.

Design: one parameterized helper and three cases next to #3056's test, against real loopback servers. Catches the mutation that marks every unreachable probe timedOut. The refused case cannot count the probe on a closed listener, so it proves the attempt by elimination (a skipped probe would report a timeout); the comment says so. Rejected: a production hook or socket spy to count the attempt (production change for a test), and a separate file (no size ratchet trip).

Overlap: open #3050 touches the lifecycle and launch-spec files, not the transport test file.

Touched files: 1.

Validation

  • SHA: 00833fba65c21ad01000766eea1e555dd56180c5
  • pnpm format, then pnpm check:affected --run: all runnable checks passed (transport test file: 8 passed).
  • No live device run; test-only, loopback HTTP.
  • Unresolved risk: the refused case has no direct proof that /health was reached.