summaryrefslogtreecommitdiff
path: root/jstests/hooks
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-08-28 12:26:45 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-09-05 15:47:58 -0400
commitfdf3ac3da53134ffac8f3d51a8faa49479daec44 (patch)
treead105561537828b5d6993f8af10c437e0c603cce /jstests/hooks
parentea179ee5116ea0fdcb5498e0415a41ecfc5120dd (diff)
downloadmongo-fdf3ac3da53134ffac8f3d51a8faa49479daec44.tar.gz
SERVER-35160 ScopedThreads should automatically inherit TestData from their parent thread
Diffstat (limited to 'jstests/hooks')
-rw-r--r--jstests/hooks/run_check_repl_dbhash.js10
-rw-r--r--jstests/hooks/validate_collections.js8
2 files changed, 7 insertions, 11 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash.js b/jstests/hooks/run_check_repl_dbhash.js
index 67c9b3c920f..51199aa6d06 100644
--- a/jstests/hooks/run_check_repl_dbhash.js
+++ b/jstests/hooks/run_check_repl_dbhash.js
@@ -6,9 +6,8 @@
load('jstests/libs/discover_topology.js'); // For Topology and DiscoverTopology.
load('jstests/libs/parallelTester.js'); // For ScopedThread.
- function checkReplicatedDataHashesThread(hosts, testData) {
+ function checkReplicatedDataHashesThread(hosts) {
try {
- TestData = testData;
const excludedDBs = jsTest.options().excludedDBsFromDBHash;
const rst = new ReplSetTest(hosts[0]);
rst.checkReplicatedDataHashes(undefined, excludedDBs);
@@ -56,8 +55,8 @@
const threads = [];
try {
if (topology.configsvr.nodes.length > 1) {
- const thread = new ScopedThread(
- checkReplicatedDataHashesThread, topology.configsvr.nodes, TestData);
+ const thread =
+ new ScopedThread(checkReplicatedDataHashesThread, topology.configsvr.nodes);
threads.push(thread);
thread.start();
} else {
@@ -79,8 +78,7 @@
}
if (shard.nodes.length > 1) {
- const thread =
- new ScopedThread(checkReplicatedDataHashesThread, shard.nodes, TestData);
+ const thread = new ScopedThread(checkReplicatedDataHashesThread, shard.nodes);
threads.push(thread);
thread.start();
} else {
diff --git a/jstests/hooks/validate_collections.js b/jstests/hooks/validate_collections.js
index dec184ce78d..29ba74e46cc 100644
--- a/jstests/hooks/validate_collections.js
+++ b/jstests/hooks/validate_collections.js
@@ -84,9 +84,7 @@ function CollectionValidator() {
};
// Run a separate thread to validate collections on each server in parallel.
- const validateCollectionsThread = function(validatorFunc, host, testData) {
- TestData = testData; // Pass the TestData object from main thread.
-
+ const validateCollectionsThread = function(validatorFunc, host) {
try {
print('Running validate() on ' + host);
const conn = new Mongo(host);
@@ -139,8 +137,8 @@ function CollectionValidator() {
try {
hostList.forEach(host => {
- const thread = new ScopedThread(
- validateCollectionsThread, this.validateCollections, host, TestData);
+ const thread =
+ new ScopedThread(validateCollectionsThread, this.validateCollections, host);
threads.push(thread);
thread.start();
});