mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 11:07:42 +00:00
* 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>
20 lines
960 B
TypeScript
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()
|
|
})
|
|
})
|