Skip to content

Commit 069ff1c

Browse files
cjihrigtargos
authored andcommitted
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: #46961 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 4b7198c commit 069ff1c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/internal/test_runner/harness.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const {
33
ArrayPrototypeForEach,
44
SafeMap,
5-
SafeWeakSet,
65
} = primordials;
76
const {
87
createHook,
@@ -25,7 +24,6 @@ const {
2524
const { bigint: hrtime } = process.hrtime;
2625

2726
const testResources = new SafeMap();
28-
const wasRootSetup = new SafeWeakSet();
2927

3028
function createTestTree(options = kEmptyObject) {
3129
return setup(new Test({ __proto__: null, ...options, name: '<root>' }));
@@ -104,7 +102,7 @@ function collectCoverage(rootTest, coverage) {
104102
}
105103

106104
function setup(root) {
107-
if (wasRootSetup.has(root)) {
105+
if (root.startTime !== null) {
108106
return root;
109107
}
110108

@@ -168,8 +166,6 @@ function setup(root) {
168166
coverage: null,
169167
};
170168
root.startTime = hrtime();
171-
172-
wasRootSetup.add(root);
173169
return root;
174170
}
175171

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy