test(mobile): advance past the probe grace in late-reply liveness tests

These six tests assert that a late reply to an already-timed-out request counts
as control-plane liveness, but only advanced 8s past the reply — inside the
two-extension grace, which absorbs the difference either way. Forcing
TimedOutControlRequestIndex.consume to return false left all six green.

16.5s clears the grace without reaching the 28s periodic-probe demote, so they
now go red when the late reply stops counting.
This commit is contained in:
Brennan Benson
2026-08-04 03:19:49 -07:00
parent 9a2e7e047a
commit 7708dd7914
2 changed files with 6 additions and 6 deletions
@@ -346,7 +346,7 @@ describe('mobile relay RPC session', () => {
JSON.stringify({ id: timedOutRequest.id, ok: true, result: {}, _meta: {} })
)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(session.getState()).toBe('connected')
expect(fakes.close).not.toHaveBeenCalled()
} finally {
@@ -817,7 +817,7 @@ describe('mobile relay RPC session', () => {
fakes.linkOptions!.onText(
JSON.stringify({ id: timedOutRequest.id, ok: true, result: {}, _meta: {} })
)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(session.getState()).toBe('connected')
expect(fakes.close).not.toHaveBeenCalled()
@@ -240,7 +240,7 @@ describe('mobile rpc-client request deadline', () => {
expect(sentRequest(socket, 'status.get')).toBeDefined()
socket.receive(`encrypted:${JSON.stringify({ id: timedOutRequest.id, ok: true, result: {} })}`)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(socket.close).not.toHaveBeenCalled()
expect(client.getState()).toBe('connected')
@@ -265,7 +265,7 @@ describe('mobile rpc-client request deadline', () => {
client.notifyForeground()
socket.receive(`encrypted:${JSON.stringify({ id: timedOutRequest.id, ok: true, result: {} })}`)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(socket.close).not.toHaveBeenCalled()
expect(client.getState()).toBe('connected')
@@ -392,7 +392,7 @@ describe('mobile rpc-client request deadline', () => {
expect(sentRequests(socket, 'status.get')).toHaveLength(2)
socket.receive(`encrypted:${JSON.stringify({ id: stalledRequest.id, ok: true, result: {} })}`)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(client.getState()).toBe('connected')
expect(socket.close).not.toHaveBeenCalled()
client.close()
@@ -420,7 +420,7 @@ describe('mobile rpc-client request deadline', () => {
expect(sentRequests(socket, 'status.get')).toHaveLength(2)
socket.receive(`encrypted:${JSON.stringify({ id: firstProbe.id, ok: true, result: {} })}`)
await vi.advanceTimersByTimeAsync(8_000)
await vi.advanceTimersByTimeAsync(16_500)
expect(client.getState()).toBe('connected')
expect(socket.close).not.toHaveBeenCalled()
client.close()