test(subagent): use valid process outcomes

This commit is contained in:
pku-xht
2026-08-18 22:48:24 +08:00
parent 1b9fd9eaa7
commit cede4fdb76
2 changed files with 6 additions and 6 deletions
@@ -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)
@@ -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()