Skip to content

Commit cdf2ba2

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 <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 2b6d9fe commit cdf2ba2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/internal/test_runner/harness.js

+1-5
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)