Explorar el Código

Merge branch 'codex/simp-compaction-surface' into codex/simp-agent-entry-state

Tianyi Cui hace 3 meses
padre
commit
f2664e91de
Se han modificado 1 ficheros con 15 adiciones y 0 borrados
  1. 15 0
      packages/support/acp-snapshot/tests/harness.spec.ts

+ 15 - 0
packages/support/acp-snapshot/tests/harness.spec.ts

@@ -274,6 +274,21 @@ describe('runScenario', () => {
     expect(failures[1]).toBe(cleanupFailure)
     expect(failures[1]).toBe(cleanupFailure)
   })
   })
 
 
+  it('reports cleanup failure after an otherwise successful scenario', { timeout: 20_000 }, async () => {
+    const { fixtureFile } = await scenario({})
+    const cleanupFailure = new Error('cleanup failed')
+    fsControl.cleanupFailure = cleanupFailure
+
+    const failure = await runScenario(
+      { steps: boot },
+      { agent: AGENT, mode: 'replay', fixtureFile },
+    ).catch((error: unknown): unknown => error)
+
+    expect(failure).toBeInstanceOf(AggregateError)
+    expect((failure as AggregateError).message).toBe('snapshot cleanup failed')
+    expect((failure as AggregateError).errors as unknown[]).toEqual([cleanupFailure])
+  })
+
   it('newSessionExpectError swallows the rejection, with and without extra dirs', { timeout: 20_000 }, async () => {
   it('newSessionExpectError swallows the rejection, with and without extra dirs', { timeout: 20_000 }, async () => {
     const { fixtureFile } = await scenario({ rejectExtraDirs: true })
     const { fixtureFile } = await scenario({ rejectExtraDirs: true })
     const result = await runScenario(
     const result = await runScenario(