Skip to content

Commit fe5dc88

Browse files
committed
benchmark: forcefully close processes
1 parent 4ecc6a4 commit fe5dc88

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+
}, 1000).unref();
298+
});
293299
} else {
294300
// Otherwise report by stdout
295301
process.stdout.write(formatResult(data));

0 commit comments

Comments
 (0)