Skip to content

Commit

Permalink
test_runner: remove root tracking set
Browse files Browse the repository at this point in the history
The wasRootSetup Set in the test harness appears to be
redundant, since the startTime field can be used interchangeably.
This commit removes wasRootSetup.

PR-URL: #46961
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
cjihrig committed Mar 7, 2023
1 parent 3d63d53 commit d4c3e3b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/internal/test_runner/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const {
ArrayPrototypeForEach,
PromiseResolve,
SafeMap,
SafeWeakSet,
} = primordials;
const {
createHook,
Expand All @@ -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: '<root>' }));
Expand Down Expand Up @@ -108,7 +106,7 @@ function collectCoverage(rootTest, coverage) {
}

function setup(root) {
if (wasRootSetup.has(root)) {
if (root.startTime !== null) {
return root;
}

Expand Down Expand Up @@ -172,8 +170,6 @@ function setup(root) {
coverage: null,
};
root.startTime = hrtime();

wasRootSetup.add(root);
return root;
}

Expand Down

0 comments on commit d4c3e3b

Please sign in to comment.