Skip to content

Commit d4c3e3b

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. PR-URL: #46961 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 3d63d53 commit d4c3e3b

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
@@ -3,7 +3,6 @@ const {
33
ArrayPrototypeForEach,
44
PromiseResolve,
55
SafeMap,
6-
SafeWeakSet,
76
} = primordials;
87
const {
98
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>' }));
@@ -108,7 +106,7 @@ function collectCoverage(rootTest, coverage) {
108106
}
109107

110108
function setup(root) {
111-
if (wasRootSetup.has(root)) {
109+
if (root.startTime !== null) {
112110
return root;
113111
}
114112

@@ -172,8 +170,6 @@ function setup(root) {
172170
coverage: null,
173171
};
174172
root.startTime = hrtime();
175-
176-
wasRootSetup.add(root);
177173
return root;
178174
}
179175

0 commit comments

Comments
 (0)