summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@mongodb.com>2019-10-17 21:17:16 +0000
committerevergreen <evergreen@mongodb.com>2019-10-17 21:17:16 +0000
commit66cc9d9c2e7db216881afc605669028c55042e5e (patch)
tree09902de65e1c17979b22429ec91ebc6587ba0099
parenta01e4d53caeb92cf07faa2507cefcfa8acbf017c (diff)
downloadmongo-66cc9d9c2e7db216881afc605669028c55042e5e.tar.gz
SERVER-43973 Use a unique test name for each thread in ParallelTester
-rw-r--r--jstests/libs/parallelTester.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/jstests/libs/parallelTester.js b/jstests/libs/parallelTester.js
index 55f446604f8..83d2878b68c 100644
--- a/jstests/libs/parallelTester.js
+++ b/jstests/libs/parallelTester.js
@@ -368,7 +368,13 @@ if (typeof _threadInject != "undefined") {
for (var i in params) {
var param = params[i];
var test = param.shift();
- var t = new Thread(wrapper, test, param, {TestData: TestData});
+
+ // Make a shallow copy of TestData so we can override the test name to
+ // prevent tests on different threads that to use jsTestName() as the
+ // collection name from colliding.
+ const clonedTestData = Object.assign({}, TestData);
+ clonedTestData.testName = `ParallelTesterThread${i}`;
+ var t = new Thread(wrapper, test, param, {TestData: clonedTestData});
runners.push(t);
}