fix(subprocess): align async pid evidence

This commit is contained in:
pku-xht
2026-08-25 22:24:20 +08:00
parent 26969588b7
commit ff413cfe5e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -155,7 +155,7 @@ function waitWithSignal<T>(promise: Promise<T>, signal: AbortSignal | undefined)
})
}
/** E2B-backed subprocess handle with deferred remote PID acquisition. */
/** E2B-backed subprocess handle with private remote process-group tracking. */
export class E2BSubprocessHandle implements SubprocessHandle {
readonly stdin: Writable | undefined
readonly stdout: PassThrough | undefined
@@ -179,8 +179,9 @@ describe.skipIf(!windowsNative)('Windows Job native containment', () => {
if (command === undefined) throw new Error('expected ComSpec for the Windows runner test')
const request = spec([command, '/d', '/s', '/c', 'exit 0'])
const launch = launchWindowsJob(request)
expect(launch.pid).toBeGreaterThan(0)
expect(launch.pid).toBeUndefined()
const failure = await launch.direct.catch((error: unknown) => error)
expect(launch.pid).toBeGreaterThan(0)
expect(failure).toMatchObject({
message: 'injected runner cwd restoration failure',
code: 'ENOENT',