diff --git a/lib/internal/test_runner/harness.js b/lib/internal/test_runner/harness.js index 168310ff3d93cd..26f5a6ef49142c 100644 --- a/lib/internal/test_runner/harness.js +++ b/lib/internal/test_runner/harness.js @@ -3,7 +3,6 @@ const { ArrayPrototypeForEach, PromiseResolve, SafeMap, - SafeWeakSet, } = primordials; const { createHook, @@ -25,7 +24,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: '' })); @@ -108,7 +106,7 @@ function collectCoverage(rootTest, coverage) { } function setup(root) { - if (wasRootSetup.has(root)) { + if (root.startTime !== null) { return root; } @@ -172,8 +170,6 @@ function setup(root) { coverage: null, }; root.startTime = hrtime(); - - wasRootSetup.add(root); return root; }