test(daemon): pin the getSize probe timeout, and reattach an orphaned comment

Review proved a coverage gap by mutation: removing LIVENESS_PROBE_TIMEOUT_MS
from the getSize request left the whole suite green, so nothing stopped that leg
regressing to the client's 30s default. Only the listSessions leg was pinned.
The assertion now fails under exactly that mutation.

Also moves isUnknownRequestTypeError below isDaemonGoneError. It had been
inserted between isDaemonGoneError and the comment describing it, so that
comment read as documenting the wrong function.
This commit is contained in:
OrcaWin
2026-08-04 02:39:25 -04:00
parent fb1c5bfea5
commit 81fc894b2e
2 changed files with 9 additions and 2 deletions
@@ -1273,6 +1273,13 @@ describe('DaemonPtyAdapter (IPtyProvider)', () => {
// The rejection is remembered, so later probes skip the round trip that cannot work.
expect(request.mock.calls.filter(([type]) => type === 'getSize')).toHaveLength(1)
// Why pinned here: a wedged daemon holds its socket open, so an unbounded getSize would
// stall a pane mount for the client's 30s default instead of answering "unknown" in 2s.
expect(request).toHaveBeenCalledWith(
'getSize',
{ sessionId: 'ambiguous-live' },
LIVENESS_PROBE_TIMEOUT_MS
)
ambiguous.dispose()
})
+2 -2
View File
@@ -2442,8 +2442,6 @@ function notifyAuditListeners<T>(listeners: readonly ((value: T) => void)[], val
}
}
// Why: syscall='connect' distinguishes a dead-socket ENOENT/ECONNREFUSED from token-file ENOENT (no syscall);
// message strings incl. wedged-daemon "Hello response timed out" (#8689) also warrant a respawn.
/**
* Narrow on purpose: only the daemon's own reply for a request type it does not implement.
* A transient failure must stay unproven rather than be mistaken for a missing capability.
@@ -2454,6 +2452,8 @@ function isUnknownRequestTypeError(err: unknown): boolean {
return err instanceof Error && err.message.includes('Unknown request type')
}
// Why: syscall='connect' distinguishes a dead-socket ENOENT/ECONNREFUSED from token-file ENOENT (no syscall);
// message strings incl. wedged-daemon "Hello response timed out" (#8689) also warrant a respawn.
function isDaemonGoneError(err: unknown): boolean {
if (!(err instanceof Error)) {
return false