diff --git a/lib/internal/test_runner/harness.js b/lib/internal/test_runner/harness.js index 95715769a3632f..748edd9fa21017 100644 --- a/lib/internal/test_runner/harness.js +++ b/lib/internal/test_runner/harness.js @@ -2,7 +2,6 @@ const { ArrayPrototypeForEach, SafeMap, - SafeWeakSet, } = primordials; const { createHook, @@ -23,7 +22,6 @@ const { const { bigint: hrtime } = process.hrtime; const testResources = new SafeMap(); -const wasRootSetup = new SafeWeakSet(); function createTestTree(options = kEmptyObject) { return setup(new Test({ __proto__: null, ...options, name: '' })); @@ -102,7 +100,7 @@ function collectCoverage(rootTest, coverage) { } function setup(root) { - if (wasRootSetup.has(root)) { + if (root.startTime !== null) { return root; } @@ -166,8 +164,6 @@ function setup(root) { coverage: null, }; root.startTime = hrtime(); - - wasRootSetup.add(root); return root; }