mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
test(codex): key the thrown-sweep mock on the swept PTY, not call order
The strand regression test rejected listStalePanes by call ordinal, so the rejection would silently attach to the wrong sweep if the flush sequence ever changed. Key it on the requested ptyIds instead.
This commit is contained in:
@@ -208,9 +208,14 @@ describe('notifyCodexPaneBoundForStaleSweep', () => {
|
||||
// and never touched by that sweep — was left with nothing to fire it, ever.
|
||||
useAppStore.setState({ ptyIdsByTabId: { 'tab-1': ['pty-1', 'pty-2'] } })
|
||||
vi.mocked(window.api.pty.inspectProcess).mockRejectedValueOnce(new Error('terminal_gone'))
|
||||
vi.mocked(window.api.codexAccounts.listStalePanes)
|
||||
.mockRejectedValueOnce(new Error('registry unreadable'))
|
||||
.mockResolvedValue([STALE_PANE])
|
||||
// Why: keyed on the swept PTY rather than call order, so the rejection stays
|
||||
// bound to pty-2's sweep even if the flush sequence changes.
|
||||
vi.mocked(window.api.codexAccounts.listStalePanes).mockImplementation(async ({ ptyIds }) => {
|
||||
if (ptyIds.includes('pty-2')) {
|
||||
throw new Error('registry unreadable')
|
||||
}
|
||||
return [STALE_PANE]
|
||||
})
|
||||
|
||||
notifyCodexPaneBoundForStaleSweep('pty-1')
|
||||
// t = 300: pty-1 reads inconclusive and parks on its 1500ms rung (due 1800).
|
||||
|
||||
Reference in New Issue
Block a user