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 <[email protected]>

* fixup

Signed-off-by: Matteo Collina <[email protected]>

---------

Signed-off-by: Matteo Collina <[email protected]>
  • Loading branch information
mcollina authored 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
Original file line number Diff line number Diff line change
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.