From bbc5b7cc344f53cf7f91b4d3b978e79b42d5ea70 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 2 Sep 2026 20:08:47 -0700 Subject: [PATCH] test(persistence): update the reattach ratchet for expired-lease reclaim markSshRemotePtyLeasesAttachedAsync is id-qualified, so a named pty that proved itself alive now returns to attached instead of staying expired. --- src/main/persistence-async-write-syscalls.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/persistence-async-write-syscalls.test.ts b/src/main/persistence-async-write-syscalls.test.ts index 3a4c1f11e87..282dc1e2988 100644 --- a/src/main/persistence-async-write-syscalls.test.ts +++ b/src/main/persistence-async-write-syscalls.test.ts @@ -821,7 +821,9 @@ describe('async persistence write path avoids synchronous fs syscalls', () => { expect(persisted.sshRemotePtyLeases).toEqual( expect.arrayContaining([ expect.objectContaining({ ptyId: 'pty-1', state: 'attached' }), - expect.objectContaining({ ptyId: 'pty-2', state: 'expired' }), + // An id-qualified reattach named this pty and succeeded, which is the one thing that can + // settle what `expired` meant: the client had lost its route, not that the shell died. + expect.objectContaining({ ptyId: 'pty-2', state: 'attached' }), expect.objectContaining({ ptyId: 'pty-3', state: 'detached' }), expect.objectContaining({ ptyId: 'pty-4', state: 'terminated' }) ])