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