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.
This commit is contained in:
Tianyi Cui
2026-07-19 13:29:31 +08:00
parent 5d6b589922
commit 97f9ec7c19
@@ -267,7 +267,7 @@ function flushLogsAndExit(): void {
`setTimeout(() => process.stderr.write(${JSON.stringify('late inherited stderr\n')}), 75)`,
].join(';')
spawn(process.execPath, ['-e', code], {
stdio: ['ignore', process.stdout, process.stderr],
stdio: ['ignore', 'inherit', 'inherit'],
}).unref()
}
process.exit(0)