Skip to content

Commit

Permalink
feat: disable FinalizationRegistry if NODE_V8_COVERAGE is set (nodejs…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tymoshenko authored and crysmags committed Feb 27, 2024
1 parent 8035c79 commit 7c79e85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ let tls // include tls conditionally since it is not always available
// re-use is enabled.

let SessionCache
if (global.FinalizationRegistry) {
// FIXME: remove workaround when the Node bug is fixed
// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
SessionCache = class WeakSessionCache {
constructor (maxCachedSessions) {
this._maxCachedSessions = maxCachedSessions
Expand Down

0 comments on commit 7c79e85

Please sign in to comment.