chore: ignore stdout when dumpio isn't used (#7644)

When the browser child process has logging enabled
and output on stdout isn't constantly processed,
the brower process is about to freeze.

To avoid such a situation at least the stdout
pipe shouldn't be set by default but only if
dumpio is enabled.

Co-authored-by: Jan Scheffler <janscheffler@chromium.org>
This commit is contained in:
Henrik Skupin 2021-10-07 23:43:57 +02:00 committed by GitHub
parent b20c2bfa24
commit 5c592913a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,13 @@ export class BrowserRunner {
start(options: LaunchOptions): void { start(options: LaunchOptions): void {
const { handleSIGINT, handleSIGTERM, handleSIGHUP, dumpio, env, pipe } = const { handleSIGINT, handleSIGTERM, handleSIGHUP, dumpio, env, pipe } =
options; options;
let stdio: Array<'ignore' | 'pipe'> = ['pipe', 'pipe', 'pipe']; let stdio: Array<'ignore' | 'pipe'>;
if (pipe) { if (pipe) {
if (dumpio) stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe']; if (dumpio) stdio = ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'];
else stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe']; else stdio = ['ignore', 'ignore', 'ignore', 'pipe', 'pipe'];
} else {
if (dumpio) stdio = ['pipe', 'pipe', 'pipe'];
else stdio = ['pipe', 'ignore', 'pipe'];
} }
assert(!this.proc, 'This process has previously been started.'); assert(!this.proc, 'This process has previously been started.');
debugLauncher( debugLauncher(