mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
test: remove 259 low-value tests (#39701)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -205,68 +205,6 @@ describe('pending PR actions', () => {
|
||||
expect(count('pr_chat_actions')).toBe(0)
|
||||
})
|
||||
|
||||
it('starts each due row once when an expired row ends inside the pass', async () => {
|
||||
const journal = await openJournal()
|
||||
const call = (ordinal: number, pr: number) =>
|
||||
journal.appendItem(
|
||||
{ provider: 'codex', threadId: 'thread-1', turnId: 'turn-1', ordinal },
|
||||
shellCall('gh pr create --fill', `https://github.com/acme/repo/pull/${pr}\n`),
|
||||
{ fence: 0, turnScope: AGENT_JOURNAL_THREAD_SCOPE }
|
||||
)
|
||||
await call(0, 7)
|
||||
clock += 25 * 60 * 60_000
|
||||
await call(1, 8)
|
||||
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] })
|
||||
try {
|
||||
// A, past its expiry, ends at once; recent B's workspace is not resolvable yet.
|
||||
const chatWorkspace = vi.fn(async () => null)
|
||||
const resume = resumeAfterRestart({ chatWorkspace })
|
||||
resume.drain()
|
||||
await vi.waitFor(() => expect(count('pr_pending_actions')).toBe(1))
|
||||
for (let pass = 0; pass < 5; pass++) {
|
||||
resume.drain()
|
||||
}
|
||||
await Promise.resolve()
|
||||
expect(chatWorkspace).toHaveBeenCalledTimes(1)
|
||||
expect(vi.getTimerCount()).toBe(1)
|
||||
resume.clear()
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('backs off a row whose end cannot be saved instead of rerunning it at once', async () => {
|
||||
const journal = await openJournal()
|
||||
await journal.appendItem(
|
||||
{ provider: 'codex', threadId: 'thread-1', turnId: 'turn-1', ordinal: 0 },
|
||||
shellCall('gh pr create --fill', 'https://github.com/acme/repo/pull/7\n'),
|
||||
{ fence: 0, turnScope: AGENT_JOURNAL_THREAD_SCOPE }
|
||||
)
|
||||
clock += 25 * 60 * 60_000
|
||||
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] })
|
||||
try {
|
||||
// The expired row ends at once, but the disk is full: its end commits nothing. A spinning
|
||||
// drain is stopped after a few turns so this fails instead of hanging.
|
||||
let resume: PRPendingActionResume | undefined
|
||||
const settle = vi.fn(() => {
|
||||
if (settle.mock.calls.length > 10) {
|
||||
resume?.clear()
|
||||
}
|
||||
throw new Error('SQLITE_FULL')
|
||||
})
|
||||
resume = resumeAfterRestart({ settle })
|
||||
resume.drain()
|
||||
expect(settle).toHaveBeenCalledTimes(2)
|
||||
settle.mockClear()
|
||||
clock += 60_000
|
||||
vi.advanceTimersByTime(60_000)
|
||||
expect(settle).toHaveBeenCalled()
|
||||
resume.clear()
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('captures nothing from an imported transcript', async () => {
|
||||
const journal = await openJournal()
|
||||
await journal.replaceEpochItems('legacy_import', 0, [
|
||||
|
||||
Reference in New Issue
Block a user