From fe5dc88b71817aeb0ee34462b77ac2b359c49fb2 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Fri, 24 Jun 2022 11:30:30 +0200 Subject: [PATCH 1/2] benchmark: forcefully close processes --- benchmark/common.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/benchmark/common.js b/benchmark/common.js index 88cb8a560f40e1..d3d7e248121768 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -289,7 +289,13 @@ function formatResult(data) { function sendResult(data) { if (process.send) { // If forked, report by process send - process.send(data); + process.send(data, () => { + // If, for any reason, the process is unable to self close within + // a second after completing, forcefully close it. + setTimeout(() => { + process.exit(0); + }, 1000).unref(); + }); } else { // Otherwise report by stdout process.stdout.write(formatResult(data)); From e1744051f48c4fbecf28a43cda936d2bcc6238e9 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Mon, 27 Jun 2022 09:30:37 +0200 Subject: [PATCH 2/2] benchmark: increase timeout --- benchmark/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/common.js b/benchmark/common.js index d3d7e248121768..080cfc71785eec 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -294,7 +294,7 @@ function sendResult(data) { // a second after completing, forcefully close it. setTimeout(() => { process.exit(0); - }, 1000).unref(); + }, 5000).unref(); }); } else { // Otherwise report by stdout