Skip to content

Commit 66cc9d9

Browse files
Robert Guoevergreen
authored andcommitted
SERVER-43973 Use a unique test name for each thread in ParallelTester
1 parent a01e4d5 commit 66cc9d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jstests/libs/parallelTester.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,13 @@ if (typeof _threadInject != "undefined") {
368368
for (var i in params) {
369369
var param = params[i];
370370
var test = param.shift();
371-
var t = new Thread(wrapper, test, param, {TestData: TestData});
371+
372+
// Make a shallow copy of TestData so we can override the test name to
373+
// prevent tests on different threads that to use jsTestName() as the
374+
// collection name from colliding.
375+
const clonedTestData = Object.assign({}, TestData);
376+
clonedTestData.testName = `ParallelTesterThread${i}`;
377+
var t = new Thread(wrapper, test, param, {TestData: clonedTestData});
372378
runners.push(t);
373379
}
374380

0 commit comments

Comments
 (0)