benchmark: fix fork detection

PR-URL: https://github.com/nodejs/node/pull/43601
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Paolo Insogna
2022-06-28 15:28:59 +02:00
parent ea99431586
commit d636fee319

View File

@@ -287,7 +287,7 @@ function formatResult(data) {
}
function sendResult(data) {
if (process.send) {
if (process.send && Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) {
// If forked, report by process send
process.send(data, () => {
// If, for any reason, the process is unable to self close within