Skip to content

Commit 3b077a6

Browse files
cjihrigdanielleadams
authored andcommittedApr 11, 2023
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 15503ff commit 3b077a6

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,
@@ -23,7 +22,6 @@ const {
2322
const { bigint: hrtime } = process.hrtime;
2423

2524
const testResources = new SafeMap();
26-
const wasRootSetup = new SafeWeakSet();
2725

2826
function createTestTree(options = kEmptyObject) {
2927
return setup(new Test({ __proto__: null, ...options, name: '<root>' }));
@@ -102,7 +100,7 @@ function collectCoverage(rootTest, coverage) {
102100
}
103101

104102
function setup(root) {
105-
if (wasRootSetup.has(root)) {
103+
if (root.startTime !== null) {
106104
return root;
107105
}
108106

@@ -166,8 +164,6 @@ function setup(root) {
166164
coverage: null,
167165
};
168166
root.startTime = hrtime();
169-
170-
wasRootSetup.add(root);
171167
return root;
172168
}
173169

0 commit comments

Comments
 (0)
Please sign in to comment.