Skip to content

Commit

Permalink
Disable FinalizationRegistry if NODE_V8_COVERAGE is set (#464)
Browse files Browse the repository at this point in the history
* Disable FinalizationRegistry if NODE_V8_COVERAGE is set

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Oct 3, 2023
1 parent dcb5e1b commit 6f30140
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/utils/build-safe-sonic-boom.js
Expand Up @@ -17,6 +17,11 @@ 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
// https://github.com/nodejs/node/issues/49344
if (!process.env.NODE_V8_COVERAGE && !opts.sync && isMainThread) {
setupOnExit(stream)
}
if (!opts.sync && isMainThread) {
setupOnExit(stream)
}
Expand Down

0 comments on commit 6f30140

Please sign in to comment.