test_runner: remove root tracking set

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: https://github.com/nodejs/node/pull/46961
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
cjihrig 2023-03-05 11:57:44 -05:00
parent 3d63d5333d
commit d4c3e3b496
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -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: '<root>' }));
@ -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;
}