Skip to content

Commit 7ee0be7

Browse files
mscdextargos
authored andcommitted
benchmark: fix output regression
Fixes: #43628 PR-URL: #43635 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent ddf7518 commit 7ee0be7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

benchmark/common.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,16 @@ function formatResult(data) {
287287
}
288288

289289
function sendResult(data) {
290-
if (process.send && Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) {
290+
if (process.send) {
291291
// If forked, report by process send
292292
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();
293+
if (Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) {
294+
// If, for any reason, the process is unable to self close within
295+
// a second after completing, forcefully close it.
296+
setTimeout(() => {
297+
process.exit(0);
298+
}, 5000).unref();
299+
}
298300
});
299301
} else {
300302
// Otherwise report by stdout

0 commit comments

Comments
 (0)