From 5c592913a818066f0fe39295ae439af6c2ad98f3 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 7 Oct 2021 23:43:57 +0200 Subject: [PATCH] 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 --- src/node/BrowserRunner.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/BrowserRunner.ts b/src/node/BrowserRunner.ts index beac06cf321..98e9a502933 100644 --- a/src/node/BrowserRunner.ts +++ b/src/node/BrowserRunner.ts @@ -64,10 +64,13 @@ export class BrowserRunner { start(options: LaunchOptions): void { const { handleSIGINT, handleSIGTERM, handleSIGHUP, dumpio, env, pipe } = options; - let stdio: Array<'ignore' | 'pipe'> = ['pipe', 'pipe', 'pipe']; + let stdio: Array<'ignore' | 'pipe'>; if (pipe) { if (dumpio) stdio = ['ignore', 'pipe', 'pipe', '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.'); debugLauncher(