Skip to content

Commit 8e160e5

Browse files
committed
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.
1 parent 7e6bc93 commit 8e160e5

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
@@ -3,7 +3,6 @@ const {
33
ArrayPrototypeForEach,
44
PromiseResolve,
55
SafeMap,
6-
SafeWeakSet,
76
} = primordials;
87
const {
98
createHook,
@@ -26,7 +25,6 @@ const {
2625
const { bigint: hrtime } = process.hrtime;
2726

2827
const testResources = new SafeMap();
29-
const wasRootSetup = new SafeWeakSet();
3028

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

107105
function setup(root) {
108-
if (wasRootSetup.has(root)) {
106+
if (root.startTime !== null) {
109107
return root;
110108
}
111109

@@ -164,8 +162,6 @@ function setup(root) {
164162
}
165163

166164
root.startTime = hrtime();
167-
168-
wasRootSetup.add(root);
169165
return root;
170166
}
171167

0 commit comments

Comments
 (0)