From 7935a3062fd50953ac658f5aa5b06f746ec10ac9 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Tue, 3 Oct 2023 17:31:57 +0200 Subject: [PATCH] Disable FinalizationRegistry if NODE_V8_COVERAGE is set Signed-off-by: Matteo Collina --- lib/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index db3536ba..23a7f2f7 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -645,7 +645,9 @@ function buildSafeSonicBoom (opts) { const stream = new SonicBoom(opts) stream.on('error', filterBrokenPipe) // if we are sync: false, we must flush on exit - if (!opts.sync && isMainThread) { + // NODE_V8_COVERAGE must breaks everything + // https://github.com/nodejs/node/issues/49344 + if (!process.env.NODE_V8_COVERAGE && !opts.sync && isMainThread) { setupOnExit(stream) } return stream