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

test(acp-snapshot): inherit descendant pipes portably

Use Node's explicit inherit stdio mode for the fake descendant instead of passing the parent process stream objects as child descriptors.

This keeps the grandchild's stdout and stderr handles open across the fake ACP parent's exit on Windows, so launcher shutdown must drain the late buffered update and stderr bytes just as it does on POSIX.
Tianyi Cui 2 месяцев назад
Родитель
Сommit
97f9ec7c19
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts

+ 1 - 1
packages/support/acp-snapshot/tests/fixtures/fake-acp-agent.ts

@@ -267,7 +267,7 @@ function flushLogsAndExit(): void {
       `setTimeout(() => process.stderr.write(${JSON.stringify('late inherited stderr\n')}), 75)`,
       `setTimeout(() => process.stderr.write(${JSON.stringify('late inherited stderr\n')}), 75)`,
     ].join(';')
     ].join(';')
     spawn(process.execPath, ['-e', code], {
     spawn(process.execPath, ['-e', code], {
-      stdio: ['ignore', process.stdout, process.stderr],
+      stdio: ['ignore', 'inherit', 'inherit'],
     }).unref()
     }).unref()
   }
   }
   process.exit(0)
   process.exit(0)