Skip to content

Commit f9c30ab

Browse files
ShogunPandatargos
authored andcommitted
benchmark: forcefully close processes
PR-URL: #43557 Fixes: nodejs/build#2968 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 4df96b5 commit f9c30ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

benchmark/common.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ function formatResult(data) {
289289
function sendResult(data) {
290290
if (process.send) {
291291
// If forked, report by process send
292-
process.send(data);
292+
process.send(data, () => {
293+
// If, for any reason, the process is unable to self close within
294+
// a second after completing, forcefully close it.
295+
setTimeout(() => {
296+
process.exit(0);
297+
}, 5000).unref();
298+
});
293299
} else {
294300
// Otherwise report by stdout
295301
process.stdout.write(formatResult(data));

0 commit comments

Comments
 (0)