Jelajahi Sumber

test(subagent): use valid process outcomes

pku-xht 1 bulan lalu
induk
melakukan
cede4fdb76

+ 2 - 2
packages/subagent/subagent-claude-code/tests/subagent-claude-code.spec.ts

@@ -1396,7 +1396,7 @@ describe('run publication, cancellation, and settlement', () => {
     queryMock.mockImplementationOnce(({ options }) => {
       factoryController = options.abortController
       options.spawnClaudeCodeProcess!(sdkSpawnOptions())
-      spawned.settle({ exitCode: 17, signal: 'SIGABRT' })
+      spawned.settle({ exitCode: 17, signal: null })
       throw new Error('query construction failed')
     })
     const factoryFailure = startClaudeCodeRun(request(), {
@@ -1409,7 +1409,7 @@ describe('run publication, cancellation, and settlement', () => {
     await expect(factoryFailure).rejects.toThrow(expectedFailureDiagnostic(
       'query-start',
       'unknown',
-      { exitCode: 17, signal: 'SIGABRT' },
+      { exitCode: 17, signal: null },
     ))
     await expect(factoryFailure).rejects.not.toThrow('query construction failed')
     expect(spawnSpecs).toHaveLength(1)

+ 4 - 4
packages/subagent/subagent-codex/tests/subagent-codex.spec.ts

@@ -1708,7 +1708,7 @@ describe('run lifecycle and quiescence', () => {
         codexErrorInfo: 'other',
       }))
       child.fromChild.end()
-      child.settle({ exitCode: 17, signal: 'SIGABRT' })
+      child.settle({ exitCode: 17, signal: null })
       await expect(run.result).resolves.toEqual({
         output: [],
         diagnostic: expectedFailureDiagnostic('turn', 'other'),
@@ -1725,7 +1725,7 @@ describe('run lifecycle and quiescence', () => {
         turnCompleted('completed'),
       )
       child.fromChild.end()
-      child.settle({ exitCode: 17, signal: 'SIGABRT' })
+      child.settle({ exitCode: 17, signal: null })
       await expect(run.result).resolves.toEqual({
         output: [{ type: 'text', text: 'answer' }],
         stopReason: 'completed',
@@ -1967,11 +1967,11 @@ describe('run lifecycle and quiescence', () => {
     })
     await exitedThreadChild.peer.nextMethod('initialized')
     await exitedThreadChild.peer.nextMethod('thread/start')
-    exitedThreadChild.settle({ exitCode: 17, signal: 'SIGABRT' })
+    exitedThreadChild.settle({ exitCode: null, signal: 'SIGABRT' })
     await expect(exitedThreadStarting).rejects.toThrow(expectedFailureDiagnostic(
       'thread-start',
       'unknown',
-      { outcome: { exitCode: 17, signal: 'SIGABRT' } },
+      { outcome: { exitCode: null, signal: 'SIGABRT' } },
     ))
 
     const stderrChild = fakeChild()