diff options
Diffstat (limited to 'jstests/multiVersion/libs')
-rw-r--r-- | jstests/multiVersion/libs/data_generators.js | 2 | ||||
-rw-r--r-- | jstests/multiVersion/libs/dumprestore_helpers.js | 7 | ||||
-rw-r--r-- | jstests/multiVersion/libs/global_snapshot_reads_helpers.js | 18 | ||||
-rw-r--r-- | jstests/multiVersion/libs/initial_sync.js | 1 | ||||
-rw-r--r-- | jstests/multiVersion/libs/multi_cluster.js | 1 | ||||
-rw-r--r-- | jstests/multiVersion/libs/multi_rs.js | 3 | ||||
-rw-r--r-- | jstests/multiVersion/libs/sharded_txn_upgrade_downgrade_cluster_shared.js | 14 | ||||
-rw-r--r-- | jstests/multiVersion/libs/verify_collection_data.js | 2 | ||||
-rw-r--r-- | jstests/multiVersion/libs/verify_versions.js | 59 |
9 files changed, 53 insertions, 54 deletions
diff --git a/jstests/multiVersion/libs/data_generators.js b/jstests/multiVersion/libs/data_generators.js index edf358b8319..5f3ccf20e10 100644 --- a/jstests/multiVersion/libs/data_generators.js +++ b/jstests/multiVersion/libs/data_generators.js @@ -612,7 +612,7 @@ function CollectionMetadataGenerator(options) { for (var option in options) { if (options.hasOwnProperty(option)) { if (option === 'capped') { - if (typeof(options['capped']) !== 'boolean') { + if (typeof (options['capped']) !== 'boolean') { throw Error( "\"capped\" options must be boolean in CollectionMetadataGenerator"); } diff --git a/jstests/multiVersion/libs/dumprestore_helpers.js b/jstests/multiVersion/libs/dumprestore_helpers.js index c62c817332b..5ee3bac4306 100644 --- a/jstests/multiVersion/libs/dumprestore_helpers.js +++ b/jstests/multiVersion/libs/dumprestore_helpers.js @@ -55,10 +55,9 @@ function multiVersionDumpRestoreTest(configObj) { var shardingTestConfig = { name: testBaseName + "_sharded_source", mongos: [{binVersion: configObj.serverSourceVersion}], - shards: [{ - binVersion: configObj.serverSourceVersion, - storageEngine: configObj.storageEngine - }], + shards: [ + {binVersion: configObj.serverSourceVersion, storageEngine: configObj.storageEngine} + ], config: [{binVersion: configObj.serverSourceVersion}] }; var shardingTest = new ShardingTest(shardingTestConfig); diff --git a/jstests/multiVersion/libs/global_snapshot_reads_helpers.js b/jstests/multiVersion/libs/global_snapshot_reads_helpers.js index be7730fdc99..407da4bbc7a 100644 --- a/jstests/multiVersion/libs/global_snapshot_reads_helpers.js +++ b/jstests/multiVersion/libs/global_snapshot_reads_helpers.js @@ -41,11 +41,11 @@ function runCommandAndVerifyResponse(sessionDb, txnNumber, cmdObj, expectSuccess return true; }); } else { - assert.commandFailedWithCode(sessionDb.runCommand(cmdObj), - expectedCode, - "command did not fail with expected error code, cmd: " + - tojson(cmdObj) + ", expectedCode: " + - tojson(expectedCode)); + assert.commandFailedWithCode( + sessionDb.runCommand(cmdObj), + expectedCode, + "command did not fail with expected error code, cmd: " + tojson(cmdObj) + + ", expectedCode: " + tojson(expectedCode)); } return txnNumber; } @@ -73,10 +73,10 @@ function verifyGlobalSnapshotReads(conn, expectSuccess, expectedCode) { txnNumber = runCommandAndVerifyResponse(shardedDb, txnNumber, { - find: "sharded", - filter: {x: 1}, - readConcern: {level: "snapshot"}, - txnNumber: NumberLong(txnNumber) + find: "sharded", + filter: {x: 1}, + readConcern: {level: "snapshot"}, + txnNumber: NumberLong(txnNumber) }, expectSuccess, expectedCode); diff --git a/jstests/multiVersion/libs/initial_sync.js b/jstests/multiVersion/libs/initial_sync.js index 4999a6a2405..329602f0c4b 100644 --- a/jstests/multiVersion/libs/initial_sync.js +++ b/jstests/multiVersion/libs/initial_sync.js @@ -12,7 +12,6 @@ load("./jstests/replsets/rslib.js"); */ var multversionInitialSyncTest = function( name, replSetVersion, newNodeVersion, configSettings, fcv) { - var nodes = {n1: {binVersion: replSetVersion}, n2: {binVersion: replSetVersion}}; jsTestLog("Starting up a two-node '" + replSetVersion + "' version replica set."); diff --git a/jstests/multiVersion/libs/multi_cluster.js b/jstests/multiVersion/libs/multi_cluster.js index 2937d0d4d6d..e611e541c3f 100644 --- a/jstests/multiVersion/libs/multi_cluster.js +++ b/jstests/multiVersion/libs/multi_cluster.js @@ -89,7 +89,6 @@ ShardingTest.prototype.upgradeCluster = function(binVersion, options) { }; ShardingTest.prototype.restartMongoses = function() { - var numMongoses = this._mongos.length; for (var i = 0; i < numMongoses; i++) { diff --git a/jstests/multiVersion/libs/multi_rs.js b/jstests/multiVersion/libs/multi_rs.js index 60bc253d877..ce67a5ed157 100644 --- a/jstests/multiVersion/libs/multi_rs.js +++ b/jstests/multiVersion/libs/multi_rs.js @@ -15,7 +15,6 @@ ReplSetTest.prototype.upgradeSet = function(options, user, pwd) { // Then upgrade the primary after stepping down. this.upgradePrimary(primary, options, user, pwd); - }; ReplSetTest.prototype.upgradeSecondaries = function(primary, options, user, pwd) { @@ -125,7 +124,7 @@ ReplSetTest.prototype.reconnect = function(node) { this.nodes[nodeId] = new Mongo(node.host); var except = {}; for (var i in node) { - if (typeof(node[i]) == "function") + if (typeof (node[i]) == "function") continue; this.nodes[nodeId][i] = node[i]; } diff --git a/jstests/multiVersion/libs/sharded_txn_upgrade_downgrade_cluster_shared.js b/jstests/multiVersion/libs/sharded_txn_upgrade_downgrade_cluster_shared.js index 0f77983adbf..2c74d3c632e 100644 --- a/jstests/multiVersion/libs/sharded_txn_upgrade_downgrade_cluster_shared.js +++ b/jstests/multiVersion/libs/sharded_txn_upgrade_downgrade_cluster_shared.js @@ -46,7 +46,9 @@ function runTxn(testDB, collName, {lsid, txnNumber}, {multiShard}) { insert: collName, documents: docs, txnNumber: NumberLong(txnNumber), - startTransaction: true, lsid, autocommit, + startTransaction: true, + lsid, + autocommit, }); if (!startTransactionRes.ok) { return startTransactionRes; @@ -55,7 +57,9 @@ function runTxn(testDB, collName, {lsid, txnNumber}, {multiShard}) { const secondStatementRes = testDB.runCommand({ insert: collName, documents: docs, - txnNumber: NumberLong(txnNumber), lsid, autocommit, + txnNumber: NumberLong(txnNumber), + lsid, + autocommit, }); if (!secondStatementRes.ok) { return secondStatementRes; @@ -82,7 +86,8 @@ function assertMultiShardRetryableWriteWorked(testDB, collName, {lsid, txnNumber assert.commandWorked(testDB.runCommand({ insert: collName, documents: [{skey: -1, fromRetryableWrite: true}, {skey: 1, fromRetryableWrite: true}], - txnNumber: NumberLong(txnNumber), lsid + txnNumber: NumberLong(txnNumber), + lsid })); } @@ -93,7 +98,8 @@ function assertMultiShardRetryableWriteCanBeRetried(testDB, collName, {lsid, txn assert.commandWorked(testDB.runCommand({ insert: collName, documents: [{skey: -1, fromRetryableWrite: true}, {skey: 1, fromRetryableWrite: true}], - txnNumber: NumberLong(txnNumber), lsid + txnNumber: NumberLong(txnNumber), + lsid })); assert.eq(numMultiShardRetryableWrites * 2, // Each write inserts 2 documents. testDB[collName].find({fromRetryableWrite: true}).itcount()); diff --git a/jstests/multiVersion/libs/verify_collection_data.js b/jstests/multiVersion/libs/verify_collection_data.js index b8eeca557f7..10b26534ccc 100644 --- a/jstests/multiVersion/libs/verify_collection_data.js +++ b/jstests/multiVersion/libs/verify_collection_data.js @@ -22,7 +22,6 @@ load('./jstests/multiVersion/libs/data_generators.js'); // Function to actually add the data generated by the given dataGenerator to a collection createCollectionWithData = function(db, collectionName, dataGenerator) { - // Drop collection if exists // TODO: add ability to control this db.getCollection(collectionName).drop(); @@ -104,7 +103,6 @@ function CollectionDataValidator() { this.validateCollectionData = function( collection, dbVersionForCollection, options = {indexSpecFieldsToSkip: []}) { - if (!_initialized) { throw Error("validateCollectionWithAllData called, but data is not initialized"); } diff --git a/jstests/multiVersion/libs/verify_versions.js b/jstests/multiVersion/libs/verify_versions.js index f20da90de80..fcc9345e276 100644 --- a/jstests/multiVersion/libs/verify_versions.js +++ b/jstests/multiVersion/libs/verify_versions.js @@ -4,39 +4,38 @@ var Mongo, assert; (function() { - "use strict"; - Mongo.prototype.getBinVersion = function() { - var result = this.getDB("admin").runCommand({serverStatus: 1}); - return result.version; - }; +"use strict"; +Mongo.prototype.getBinVersion = function() { + var result = this.getDB("admin").runCommand({serverStatus: 1}); + return result.version; +}; - // Checks that our mongodb process is of a certain version - assert.binVersion = function(mongo, version) { - var currVersion = mongo.getBinVersion(); - assert(MongoRunner.areBinVersionsTheSame(MongoRunner.getBinVersionFor(currVersion), - MongoRunner.getBinVersionFor(version)), - "version " + version + " (" + MongoRunner.getBinVersionFor(version) + ")" + - " is not the same as " + MongoRunner.getBinVersionFor(currVersion)); - }; +// Checks that our mongodb process is of a certain version +assert.binVersion = function(mongo, version) { + var currVersion = mongo.getBinVersion(); + assert(MongoRunner.areBinVersionsTheSame(MongoRunner.getBinVersionFor(currVersion), + MongoRunner.getBinVersionFor(version)), + "version " + version + " (" + MongoRunner.getBinVersionFor(version) + ")" + + " is not the same as " + MongoRunner.getBinVersionFor(currVersion)); +}; - // Compares an array of desired versions and an array of found versions, - // looking for versions not found - assert.allBinVersions = function(versionsWanted, versionsFound) { - - for (var i = 0; i < versionsWanted.length; i++) { - var version = versionsWanted[i]; - var found = false; - for (var j = 0; j < versionsFound.length; j++) { - if (MongoRunner.areBinVersionsTheSame(version, versionsFound[j])) { - found = true; - break; - } +// Compares an array of desired versions and an array of found versions, +// looking for versions not found +assert.allBinVersions = function(versionsWanted, versionsFound) { + for (var i = 0; i < versionsWanted.length; i++) { + var version = versionsWanted[i]; + var found = false; + for (var j = 0; j < versionsFound.length; j++) { + if (MongoRunner.areBinVersionsTheSame(version, versionsFound[j])) { + found = true; + break; } - - assert(found, - "could not find version " + version + " (" + - MongoRunner.getBinVersionFor(version) + ")" + " in " + versionsFound); } - }; + assert(found, + "could not find version " + version + " (" + MongoRunner.getBinVersionFor(version) + + ")" + + " in " + versionsFound); + } +}; }()); |