Files
orca/src/shared/ssh-pending-pty-kill.test.ts
T
OrcaWinandm4air b15c2c6dd6 refactor(persistence): retire the dead SSH PTY lease writers (#27555)
* test(persistence): seed relay-era SSH lease rows from disk

* refactor(persistence): retire the dead SSH PTY lease writers

* test(persistence): read relay-era recovery rows without a cast

* chore(ratchet): prune layout-writer baseline after lease writer removal

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
2026-10-11 12:46:50 -07:00

20 lines
960 B
TypeScript

import { describe, expect, it } from 'vitest'
import { normalizeSshPendingPtyKill } from './ssh-pending-pty-kill'
// A close whose incarnation was never learned still owes the kill only when the id is epoch-scoped:
// a `pty2:` id carries a per-start mint epoch, so the id alone names one process.
describe('normalizeSshPendingPtyKill', () => {
const unfenced = { requestedAt: 1_800_000_000_000, attempts: 0 }
it('keeps an unfenced order for an epoch-scoped relay id and drops it for a legacy one', () => {
expect(normalizeSshPendingPtyKill(unfenced, 'pty2:epoch-a:3')).toEqual(unfenced)
expect(normalizeSshPendingPtyKill(unfenced, 'pty-3')).toBeNull()
})
it('keeps a fenced order and drops a malformed one', () => {
const fenced = { ...unfenced, incarnationId: 'inc-a' }
expect(normalizeSshPendingPtyKill(fenced, 'pty-3')).toEqual(fenced)
expect(normalizeSshPendingPtyKill({ attempts: 0 }, 'pty2:epoch-a:3')).toBeNull()
})
})