From b070fa2672b0dd5372c57a763624c5b5205dea29 Mon Sep 17 00:00:00 2001 From: Ali Hassan Date: Sat, 6 Apr 2024 03:57:18 +0500 Subject: [PATCH] benchmark: fix stdio on stderr for child process --- benchmark/compare.js | 6 +++++- benchmark/run.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/benchmark/compare.js b/benchmark/compare.js index db8ef90b3c4451..96094a9278737c 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -83,12 +83,16 @@ if (showProgress) { const spawnArgs = ['-c', cpuCore, cli.optional[job.binary], resolvedPath, ...cli.optional.set]; child = spawn('taskset', spawnArgs, { env: process.env, - stdio: ['inherit', 'pipe', 'ipc'], + stdio: ['inherit', 'pipe', 'pipe'], }); child.stdout.on('data', (data) => { process.stdout.write(data); }); + + child.stderr.on('data', (data) => { + process.stdout.write(data); + }); } else { child = fork(resolvedPath, cli.optional.set, { execPath: cli.optional[job.binary], diff --git a/benchmark/run.js b/benchmark/run.js index 4df166b91b2c2e..1d6fd1f3e4f487 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -54,12 +54,16 @@ if (format === 'csv') { let child; if (cpuCore !== null) { child = spawn('taskset', ['-c', cpuCore, 'node', scriptPath, ...args], { - stdio: ['inherit', 'pipe', 'ipc'], + stdio: ['inherit', 'pipe', 'pipe'], }); child.stdout.on('data', (data) => { process.stdout.write(data); }); + + child.stderr.on('data', (data) => { + process.stderr.write(data); + }); } else { child = fork( scriptPath,