Просмотр исходного кода

fix(subprocess): align async pid evidence

pku-xht 2 недель назад
Родитель
Сommit
ff413cfe5e

+ 1 - 1
packages/e2b/subprocess-e2b/src/process.ts

@@ -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

+ 2 - 1
packages/subprocess/subprocess-local/tests/native-windows.spec.ts

@@ -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',