From cc41e10c5fb97d2c6479724d26277863b17573b9 Mon Sep 17 00:00:00 2001 From: kvwalker Date: Fri, 8 Sep 2017 12:11:02 -0400 Subject: SERVER-30923 Increase wtimeouts to ReplSetTest.kDefaultTimeoutMS in all replication jstests --- jstests/replsets/auth1.js | 8 ++++---- jstests/replsets/chaining_removal.js | 2 +- jstests/replsets/clean_shutdown_oplog_state.js | 4 ++-- jstests/replsets/double_rollback.js | 6 +++--- jstests/replsets/initial_sync_with_write_load.js | 3 ++- jstests/replsets/linearizable_read_concern.js | 3 ++- jstests/replsets/read_committed_no_snapshots.js | 2 +- jstests/replsets/read_committed_on_secondary.js | 2 +- jstests/replsets/read_committed_with_catalog_changes.js | 4 ++-- jstests/replsets/replset2.js | 6 +++--- jstests/replsets/replset5.js | 2 +- jstests/replsets/resync.js | 5 +++-- jstests/replsets/resync_with_write_load.js | 3 ++- jstests/replsets/rollback5.js | 6 +++--- jstests/replsets/rollback_cmd_unrollbackable.js | 6 +++--- jstests/replsets/rollback_collMod_PowerOf2Sizes.js | 4 ++-- jstests/replsets/rollback_collMod_fatal.js | 6 +++--- jstests/replsets/rollback_different_h.js | 6 +++--- jstests/replsets/rollback_index.js | 8 ++++---- jstests/replsets/rollback_too_new.js | 4 ++-- jstests/replsets/rollback_with_socket_error_then_steady_state.js | 6 +++--- jstests/replsets/shutdown_primary.js | 2 +- jstests/replsets/slavedelay1.js | 4 ++-- jstests/replsets/stepdown_killop.js | 4 ++-- jstests/replsets/stepdown_long_wait_time.js | 2 +- jstests/replsets/stepdown_needs_electable_secondary.js | 2 +- jstests/replsets/stepdown_needs_majority.js | 2 +- jstests/replsets/tags2.js | 2 +- jstests/replsets/tags_with_reconfig.js | 2 +- jstests/replsets/temp_namespace_restart_as_standalone.js | 5 +++-- 30 files changed, 63 insertions(+), 58 deletions(-) diff --git a/jstests/replsets/auth1.js b/jstests/replsets/auth1.js index 4c4110597c5..9ab12cc7157 100644 --- a/jstests/replsets/auth1.js +++ b/jstests/replsets/auth1.js @@ -74,8 +74,8 @@ load("jstests/replsets/rslib.js"); var mId = rs.getNodeId(master); var slave = rs.liveNodes.slaves[0]; assert.eq(1, master.getDB("admin").auth("foo", "bar")); - assert.writeOK( - master.getDB("test").foo.insert({x: 1}, {writeConcern: {w: 3, wtimeout: 60000}})); + assert.writeOK(master.getDB("test").foo.insert( + {x: 1}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); print("try some legal and illegal reads"); var r = master.getDB("test").foo.findOne(); @@ -116,7 +116,7 @@ load("jstests/replsets/rslib.js"); for (var i = 0; i < 1000; i++) { bulk.insert({x: i, foo: "bar"}); } - assert.writeOK(bulk.execute({w: 3, wtimeout: 60000})); + assert.writeOK(bulk.execute({w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS})); print("fail over"); rs.stop(mId); @@ -140,7 +140,7 @@ load("jstests/replsets/rslib.js"); for (var i = 0; i < 1000; i++) { bulk.insert({x: i, foo: "bar"}); } - bulk.execute({w: 3, wtimeout: 60000}); + bulk.execute({w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}); print("add member with wrong key"); var conn = MongoRunner.runMongod({ diff --git a/jstests/replsets/chaining_removal.js b/jstests/replsets/chaining_removal.js index d0cc9b3ed56..290a17076e9 100644 --- a/jstests/replsets/chaining_removal.js +++ b/jstests/replsets/chaining_removal.js @@ -41,7 +41,7 @@ syncFrom(nodes[4], nodes[1], replTest); // write that should reach all nodes - var timeout = 60 * 1000; + var timeout = ReplSetTest.kDefaultTimeoutMS; var options = {writeConcern: {w: numNodes, wtimeout: timeout}}; assert.writeOK(primary.getDB(name).foo.insert({x: 1}, options)); diff --git a/jstests/replsets/clean_shutdown_oplog_state.js b/jstests/replsets/clean_shutdown_oplog_state.js index ee31bd2c281..effa8469d7b 100644 --- a/jstests/replsets/clean_shutdown_oplog_state.js +++ b/jstests/replsets/clean_shutdown_oplog_state.js @@ -32,8 +32,8 @@ // Start a w:2 write that will block until replication is resumed. var waitForReplStart = startParallelShell(function() { - printjson(assert.writeOK( - db.getCollection('side').insert({}, {writeConcern: {w: 2, wtimeout: 30 * 60 * 1000}}))); + printjson(assert.writeOK(db.getCollection('side').insert( + {}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}}))); }, primary.host.split(':')[1]); // Insert a lot of data in increasing order to test.coll. diff --git a/jstests/replsets/double_rollback.js b/jstests/replsets/double_rollback.js index 1b819cd2452..2bcc384d3ef 100644 --- a/jstests/replsets/double_rollback.js +++ b/jstests/replsets/double_rollback.js @@ -40,7 +40,7 @@ assert.eq(nodes[0], rst.getPrimary()); // Wait for all data bearing nodes to get up to date. assert.writeOK(nodes[0].getDB(dbName).getCollection(collName).insert( - {a: 1}, {writeConcern: {w: 3, wtimeout: 5 * 60 * 1000}})); + {a: 1}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); jsTestLog("Create two partitions: [1] and [0,2,3,4]."); nodes[1].disconnect(nodes[0]); @@ -50,7 +50,7 @@ jsTestLog("Do a write that is replicated to [0,2,3,4]."); assert.writeOK(nodes[0].getDB(dbName).getCollection(collName + "2").insert({a: 2}, { - writeConcern: {w: 2, wtimeout: 5 * 60 * 1000} + writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS} })); jsTestLog("Repartition to: [0,2] and [1,3,4]."); @@ -137,7 +137,7 @@ // Node 1 should still be primary, and should now be able to satisfy majority writes again. assert.writeOK(nodes[1].getDB(dbName).getCollection(collName + "4").insert({a: 4}, { - writeConcern: {w: 3, wtimeout: 5 * 60 * 1000} + writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS} })); }()); diff --git a/jstests/replsets/initial_sync_with_write_load.js b/jstests/replsets/initial_sync_with_write_load.js index a6dba557b87..2abbb878cb4 100644 --- a/jstests/replsets/initial_sync_with_write_load.js +++ b/jstests/replsets/initial_sync_with_write_load.js @@ -35,7 +35,8 @@ assert(master == conns[0], "conns[0] assumed to be master"); assert(a_conn.host == master.host); // create an oplog entry with an insert -assert.writeOK(A.foo.insert({x: 1}, {writeConcern: {w: 1, wtimeout: 60000}})); +assert.writeOK( + A.foo.insert({x: 1}, {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); replTest.stop(BID); print("******************** starting load for 30 secs *********************"); diff --git a/jstests/replsets/linearizable_read_concern.js b/jstests/replsets/linearizable_read_concern.js index b931146bcf3..80c435aaccb 100644 --- a/jstests/replsets/linearizable_read_concern.js +++ b/jstests/replsets/linearizable_read_concern.js @@ -52,7 +52,8 @@ load('jstests/libs/write_concern_util.js'); // Do a write to have something to read. assert.writeOK(primary.getDB("test").foo.insert( - {"number": 7}, {"writeConcern": {"w": "majority", "wtimeout": 60000}})); + {"number": 7}, + {"writeConcern": {"w": "majority", "wtimeout": ReplSetTest.kDefaultTimeoutMS}})); jsTestLog("Testing linearizable readConcern parsing"); // This command is sent to the primary, and the primary is fully connected so it should work. diff --git a/jstests/replsets/read_committed_no_snapshots.js b/jstests/replsets/read_committed_no_snapshots.js index 77c061eeb18..120129f3a57 100644 --- a/jstests/replsets/read_committed_no_snapshots.js +++ b/jstests/replsets/read_committed_no_snapshots.js @@ -44,7 +44,7 @@ load("jstests/replsets/rslib.js"); // For reconfig and startSetIfSupportsReadMa { insert: "foo", documents: [{_id: 1, state: 0}], - writeConcern: {w: "majority", wtimeout: 60 * 1000} + writeConcern: {w: "majority", wtimeout: ReplSetTest.kDefaultTimeoutMS} }, {"$replData": 1}); assert.commandWorked(res.commandReply); diff --git a/jstests/replsets/read_committed_on_secondary.js b/jstests/replsets/read_committed_on_secondary.js index a876a32c2a3..aca4d77c459 100644 --- a/jstests/replsets/read_committed_on_secondary.js +++ b/jstests/replsets/read_committed_on_secondary.js @@ -66,7 +66,7 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. var res = dbPrimary.runCommandWithMetadata( // { update: name, - writeConcern: {w: 2, wtimeout: 60 * 1000}, + writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, updates: [{q: {_id: 1}, u: {_id: 1, state: state}, upsert: true}], }, {"$replData": 1}); diff --git a/jstests/replsets/read_committed_with_catalog_changes.js b/jstests/replsets/read_committed_with_catalog_changes.js index dc67333cca6..5516f42792e 100644 --- a/jstests/replsets/read_committed_with_catalog_changes.js +++ b/jstests/replsets/read_committed_with_catalog_changes.js @@ -262,8 +262,8 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. // This DB won't be used by any tests so it should always be unblocked. var otherDB = primary.getDB('otherDB'); var otherDBCollection = otherDB.collection; - assert.writeOK( - otherDBCollection.insert({}, {writeConcern: {w: "majority", wtimeout: 60 * 1000}})); + assert.writeOK(otherDBCollection.insert( + {}, {writeConcern: {w: "majority", wtimeout: ReplSetTest.kDefaultTimeoutMS}})); assertReadsSucceed(otherDBCollection); for (var testName in testCases) { diff --git a/jstests/replsets/replset2.js b/jstests/replsets/replset2.js index d5080072dbc..c79da20be99 100644 --- a/jstests/replsets/replset2.js +++ b/jstests/replsets/replset2.js @@ -47,7 +47,7 @@ doTest = function(signal) { printjson(master.getDB("admin").runCommand("replSetGetStatus")); - assert.writeOK(bulk.execute({w: 3, wtimeout: 60000})); + assert.writeOK(bulk.execute({w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS})); print("replset2.js **** TEMP 1a ****"); @@ -66,7 +66,7 @@ doTest = function(signal) { // Test write concern with a simple insert print("replset2.js **** Try inserting a single record ****"); master.getDB(testDB).dropDatabase(); - var options = {writeConcern: {w: 3, wtimeout: 60000}}; + var options = {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(master.getDB(testDB).foo.insert({n: 1}, options)); m1 = master.getDB(testDB).foo.findOne({n: 1}); @@ -86,7 +86,7 @@ doTest = function(signal) { for (var n = 0; n < 1000; n++) { bulk.insert({n: n, data: bigData}); } - assert.writeOK(bulk.execute({w: 3, wtimeout: 60000})); + assert.writeOK(bulk.execute({w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS})); print("replset2.js **** V1 "); diff --git a/jstests/replsets/replset5.js b/jstests/replsets/replset5.js index 25c073571f1..9d157d580c7 100644 --- a/jstests/replsets/replset5.js +++ b/jstests/replsets/replset5.js @@ -11,7 +11,7 @@ load("jstests/replsets/rslib.js"); // Initiate set with default for write concern var config = replTest.getReplSetConfig(); config.settings = {}; - config.settings.getLastErrorDefaults = {'w': 3, 'wtimeout': 5 * 60 * 1000}; + config.settings.getLastErrorDefaults = {'w': 3, 'wtimeout': ReplSetTest.kDefaultTimeoutMS}; config.settings.heartbeatTimeoutSecs = 15; // Prevent node 2 from becoming primary, as we will attempt to set it to hidden later. config.members[2].priority = 0; diff --git a/jstests/replsets/resync.js b/jstests/replsets/resync.js index 885f72f7729..8a6a35ee699 100644 --- a/jstests/replsets/resync.js +++ b/jstests/replsets/resync.js @@ -45,7 +45,8 @@ var BID = replTest.getNodeId(b_conn); // create an oplog entry with an insert - assert.writeOK(A.foo.insert({x: 1}, {writeConcern: {w: 2, wtimeout: 60000}})); + assert.writeOK( + A.foo.insert({x: 1}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); assert.eq(B.foo.findOne().x, 1); // run resync and wait for it to happen @@ -83,7 +84,7 @@ } // wait for secondary to also have its oplog cycle - assert.writeOK(bulk.execute({w: 1, wtimeout: 60000})); + assert.writeOK(bulk.execute({w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS})); if (hasCycled()) break; diff --git a/jstests/replsets/resync_with_write_load.js b/jstests/replsets/resync_with_write_load.js index 07ecc52b93e..10df8501b91 100644 --- a/jstests/replsets/resync_with_write_load.js +++ b/jstests/replsets/resync_with_write_load.js @@ -39,7 +39,8 @@ if (false) { assert(a_conn.host == master.host); // create an oplog entry with an insert - assert.writeOK(A.foo.insert({x: 1}, {writeConcern: {w: 3, wtimeout: 60000}})); + assert.writeOK( + A.foo.insert({x: 1}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); print("******************** starting load for 30 secs *********************"); var work = function() { diff --git a/jstests/replsets/rollback5.js b/jstests/replsets/rollback5.js index 64faf8714cf..620fd67ed84 100644 --- a/jstests/replsets/rollback5.js +++ b/jstests/replsets/rollback5.js @@ -44,14 +44,14 @@ assert.soon(function() { return res.myState == 7; }, "Arbiter failed to initialize."); -var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; +var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(A.foo.update({key: 'value1'}, {$set: {req: 'req'}}, options)); replTest.stop(AID); master = replTest.getPrimary(); assert(b_conn.host == master.host); options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; assert.writeOK(B.foo.update({key: 'value1'}, {$set: {res: 'res'}}, options)); @@ -60,7 +60,7 @@ replTest.restart(AID); master = replTest.getPrimary(); assert(a_conn.host == master.host); options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; assert.writeOK(A.foo.update({key: 'value2'}, {$set: {req: 'req'}}, options)); diff --git a/jstests/replsets/rollback_cmd_unrollbackable.js b/jstests/replsets/rollback_cmd_unrollbackable.js index 051d4595d05..f544520e686 100644 --- a/jstests/replsets/rollback_cmd_unrollbackable.js +++ b/jstests/replsets/rollback_cmd_unrollbackable.js @@ -32,7 +32,7 @@ replTest.waitForState(replTest.nodes[0], ReplSetTest.State.PRIMARY); var master = replTest.getPrimary(); assert(master === conns[0], "conns[0] assumed to be master"); assert(a_conn.host === master.host, "a_conn assumed to be master"); -var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; +var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); // Shuts down the master. @@ -42,7 +42,7 @@ replTest.stop(AID); master = replTest.getPrimary(); assert(b_conn.host === master.host, "b_conn assumed to be master"); options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; // Inserts another oplog entry to set minValid ahead. @@ -63,7 +63,7 @@ assert(a_conn.host === master.host, "a_conn assumed to be master"); // Does a write so that B will have to roll back. options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; assert.writeOK(a_conn.getDB(name).foo.insert({x: 2}, options)); diff --git a/jstests/replsets/rollback_collMod_PowerOf2Sizes.js b/jstests/replsets/rollback_collMod_PowerOf2Sizes.js index 24177ebe6b7..7b99254961a 100644 --- a/jstests/replsets/rollback_collMod_PowerOf2Sizes.js +++ b/jstests/replsets/rollback_collMod_PowerOf2Sizes.js @@ -43,7 +43,7 @@ }; assert.commandWorked(a_conn.getDB(name).createCollection('foo', originalCollectionOptions)); - var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; + var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); assert.eq(getOptions(a_conn), originalCollectionOptions); @@ -72,7 +72,7 @@ b_conn = master; // Do a write on B so that A will have to roll back. - options = {writeConcern: {w: 1, wtimeout: 60000}, upsert: true}; + options = {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(b_conn.getDB(name).foo.insert({x: 2}, options)); // Restart A, which should rollback the collMod before becoming primary. diff --git a/jstests/replsets/rollback_collMod_fatal.js b/jstests/replsets/rollback_collMod_fatal.js index ed9251e8c92..393f7f59004 100644 --- a/jstests/replsets/rollback_collMod_fatal.js +++ b/jstests/replsets/rollback_collMod_fatal.js @@ -33,7 +33,7 @@ replTest.waitForState(replTest.nodes[0], ReplSetTest.State.PRIMARY); var master = replTest.getPrimary(); assert(master === conns[0], "conns[0] assumed to be master"); assert(a_conn.host === master.host, "a_conn assumed to be master"); -var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; +var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; a_conn.getDB(name).foo.ensureIndex({x: 1}, {expireAfterSeconds: 3600}); assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); @@ -54,7 +54,7 @@ assert(a_conn.host === master.host, "a_conn assumed to be master"); // Does a write so that B will have to roll back. options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; assert.writeOK(a_conn.getDB(name).foo.insert({x: 2}, options)); @@ -67,4 +67,4 @@ assert.soon(function() { }, "B failed to fassert"); replTest.stop(BID, undefined, {allowedExitCode: MongoRunner.EXIT_ABRUPT}); -replTest.stopSet(); \ No newline at end of file +replTest.stopSet(); diff --git a/jstests/replsets/rollback_different_h.js b/jstests/replsets/rollback_different_h.js index 7a924c1c683..cc242925d7b 100644 --- a/jstests/replsets/rollback_different_h.js +++ b/jstests/replsets/rollback_different_h.js @@ -42,7 +42,7 @@ replTest.waitForState(replTest.nodes[0], ReplSetTest.State.PRIMARY); var master = replTest.getPrimary(); assert(master === conns[0], "conns[0] assumed to be master"); assert(a_conn.host === master.host, "a_conn assumed to be master"); -var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; +var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); // shut down master @@ -52,7 +52,7 @@ replTest.stop(AID); master = replTest.getPrimary(); assert(b_conn.host === master.host, "b_conn assumed to be master"); options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; var oplog_entry = b_conn.getDB("local").oplog.rs.find().sort({$natural: -1})[0]; @@ -72,7 +72,7 @@ assert(a_conn.host === master.host, "a_conn assumed to be master"); // do a write so that B will have to roll back options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; assert.writeOK(a_conn.getDB(name).foo.insert({x: 2}, options)); diff --git a/jstests/replsets/rollback_index.js b/jstests/replsets/rollback_index.js index 4343e368d33..f8650d0a2d6 100644 --- a/jstests/replsets/rollback_index.js +++ b/jstests/replsets/rollback_index.js @@ -44,7 +44,7 @@ replTest.waitForState(replTest.nodes[0], ReplSetTest.State.PRIMARY); var master = replTest.getPrimary(); assert(master === conns[0], "conns[0] assumed to be master"); assert(a_conn.host === master.host, "a_conn assumed to be master"); -var options = {writeConcern: {w: 2, wtimeout: 60000}, upsert: true}; +var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true}; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); // shut down master @@ -55,7 +55,7 @@ replTest.stop(AID); master = replTest.getPrimary(); assert(b_conn.host === master.host, "b_conn assumed to be master"); options = { - writeConcern: {w: 1, wtimeout: 60000}, + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}, upsert: true }; // another insert to set minvalid ahead @@ -72,7 +72,7 @@ assert(a_conn.host === master.host, "a_conn assumed to be master"); // Insert a document with the same value for 'x' that should be // propagated successfully to B if the unique index was dropped successfully. options = { - writeConcern: {w: 1, wtimeout: 60000} + writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS} }; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); assert.eq(2, a_conn.getDB(name).foo.find().itcount(), 'invalid number of documents on A'); @@ -86,7 +86,7 @@ replTest.awaitSecondaryNodes(); // Perform a write that should succeed if there's no unique index on B. options = { - writeConcern: {w: 'majority', wtimeout: 60000} + writeConcern: {w: 'majority', wtimeout: ReplSetTest.kDefaultTimeoutMS} }; assert.writeOK(a_conn.getDB(name).foo.insert({x: 1}, options)); diff --git a/jstests/replsets/rollback_too_new.js b/jstests/replsets/rollback_too_new.js index 75aa8ec0fc4..60e0150bd5e 100644 --- a/jstests/replsets/rollback_too_new.js +++ b/jstests/replsets/rollback_too_new.js @@ -30,13 +30,13 @@ // get master and do an initial write var master = replTest.getPrimary(); - var options = {writeConcern: {w: 2, wtimeout: 60000}}; + var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(master.getDB(name).foo.insert({x: 1}, options)); // add an oplog entry from the distant future as the most recent entry on node C var future_oplog_entry = conns[2].getDB("local").oplog.rs.find().sort({$natural: -1})[0]; future_oplog_entry["ts"] = new Timestamp(future_oplog_entry["ts"].getTime() + 200000, 1); - options = {writeConcern: {w: 1, wtimeout: 60000}}; + options = {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(conns[2].getDB("local").oplog.rs.insert(future_oplog_entry, options)); replTest.stop(CID); diff --git a/jstests/replsets/rollback_with_socket_error_then_steady_state.js b/jstests/replsets/rollback_with_socket_error_then_steady_state.js index 33f6fdf2684..48c77852a84 100644 --- a/jstests/replsets/rollback_with_socket_error_then_steady_state.js +++ b/jstests/replsets/rollback_with_socket_error_then_steady_state.js @@ -47,7 +47,7 @@ assert.eq(nodes[0], rst.getPrimary()); // Wait for all data bearing nodes to get up to date. assert.writeOK(nodes[0].getCollection(collName).insert( - {a: counter++}, {writeConcern: {w: 3, wtimeout: 5 * 60 * 1000}})); + {a: counter++}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); jsTestLog("Create two partitions: [1] and [0,2,3,4]."); nodes[1].disconnect(nodes[0]); @@ -57,7 +57,7 @@ jsTestLog("Do a write that is replicated to [0,2,3,4]."); assert.writeOK(nodes[0].getCollection(collName).insert( - {a: counter++}, {writeConcern: {w: 2, wtimeout: 5 * 60 * 1000}})); + {a: counter++}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); jsTestLog("Repartition to: [0,2] and [1,3,4]."); nodes[1].reconnect(nodes[3]); @@ -118,7 +118,7 @@ jsTestLog("w:2 write to node 0 (replicated to node 2)"); assert.writeOK(nodes[0].getCollection(collName).insert( - {a: counter++}, {writeConcern: {w: 2, wtimeout: 5 * 60 * 1000}})); + {a: counter++}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); // At this point node 2 has failed rollback before making any durable changes, including writing // to minValid. That means that it is free to pick any sync source and will pick node 0 where it diff --git a/jstests/replsets/shutdown_primary.js b/jstests/replsets/shutdown_primary.js index b294ce5370d..65eb4ec3e59 100644 --- a/jstests/replsets/shutdown_primary.js +++ b/jstests/replsets/shutdown_primary.js @@ -24,7 +24,7 @@ var primary = replTest.getPrimary(); var testDB = primary.getDB(name); - var timeout = 5 * 60 * 1000; + var timeout = ReplSetTest.kDefaultTimeoutMS; assert.writeOK(testDB.foo.insert({x: 1}, {writeConcern: {w: 3, wtimeout: timeout}})); jsTestLog("Blocking replication to secondaries."); diff --git a/jstests/replsets/slavedelay1.js b/jstests/replsets/slavedelay1.js index caeb38185d0..2182db9a171 100644 --- a/jstests/replsets/slavedelay1.js +++ b/jstests/replsets/slavedelay1.js @@ -66,8 +66,8 @@ doTest = function(signal) { master = reconfig(replTest, config); master = master.getSisterDB(name); - assert.writeOK( - master.foo.insert({_id: 123, x: 'foo'}, {writeConcern: {w: 2, wtimeout: 10 * 60 * 1000}})); + assert.writeOK(master.foo.insert( + {_id: 123, x: 'foo'}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); for (var i = 0; i < 8; i++) { assert.eq(conn.getDB(name).foo.findOne({_id: 123}), null); diff --git a/jstests/replsets/stepdown_killop.js b/jstests/replsets/stepdown_killop.js index 19e084f86f8..d47738aa47e 100644 --- a/jstests/replsets/stepdown_killop.js +++ b/jstests/replsets/stepdown_killop.js @@ -38,8 +38,8 @@ // do a write then ask the PRIMARY to stepdown jsTestLog("Initiating stepdown"); - assert.writeOK(primary.getDB(name).foo.insert({myDoc: true, x: 1}, - {writeConcern: {w: 1, wtimeout: 60000}})); + assert.writeOK(primary.getDB(name).foo.insert( + {myDoc: true, x: 1}, {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); var stepDownCmd = function() { var res = db.getSiblingDB('admin').runCommand( {replSetStepDown: 60, secondaryCatchUpPeriodSecs: 60}); diff --git a/jstests/replsets/stepdown_long_wait_time.js b/jstests/replsets/stepdown_long_wait_time.js index 0a0ff485933..d2e5db242cb 100644 --- a/jstests/replsets/stepdown_long_wait_time.js +++ b/jstests/replsets/stepdown_long_wait_time.js @@ -32,7 +32,7 @@ 'Failed to configure rsSyncApplyStop failpoint.'); jsTestLog("do a write then ask the PRIMARY to stepdown"); - var options = {writeConcern: {w: 1, wtimeout: 60000}}; + var options = {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB(name).foo.insert({x: 1}, options)); var stepDownSecs = 60; var secondaryCatchUpPeriodSecs = 60; diff --git a/jstests/replsets/stepdown_needs_electable_secondary.js b/jstests/replsets/stepdown_needs_electable_secondary.js index 9cc53a4dfd7..3adb0d2b43b 100644 --- a/jstests/replsets/stepdown_needs_electable_secondary.js +++ b/jstests/replsets/stepdown_needs_electable_secondary.js @@ -65,7 +65,7 @@ jsTestLog("Doing a write to primary."); var testDB = replTest.getPrimary().getDB('testdb'); var coll = testDB.stepdown_needs_electable_secondary; - var timeout = 5 * 60 * 1000; + var timeout = ReplSetTest.kDefaultTimeoutMS; assert.writeOK( coll.insert({"dummy_key": "dummy_val"}, {writeConcern: {w: 1, wtimeout: timeout}})); diff --git a/jstests/replsets/stepdown_needs_majority.js b/jstests/replsets/stepdown_needs_majority.js index 080dd241338..ae6c909d9fe 100644 --- a/jstests/replsets/stepdown_needs_majority.js +++ b/jstests/replsets/stepdown_needs_majority.js @@ -52,7 +52,7 @@ var testDB = primary.getDB('testdb'); var coll = testDB[name]; var dummy_doc = {"dummy_key": "dummy_val"}; - var timeout = 5 * 60 * 1000; + var timeout = ReplSetTest.kDefaultTimeoutMS; // // Block writes to all secondaries diff --git a/jstests/replsets/tags2.js b/jstests/replsets/tags2.js index 15996fc6468..7ee2fe81031 100644 --- a/jstests/replsets/tags2.js +++ b/jstests/replsets/tags2.js @@ -32,7 +32,7 @@ var master = replTest.getPrimary(); var db = master.getDB("test"); - var wtimeout = 60 * 1000 * 5; + var wtimeout = ReplSetTest.kDefaultTimeoutMS; assert.writeOK(db.foo.insert({x: 1}, {writeConcern: {w: 'backedUp', wtimeout: wtimeout}})); diff --git a/jstests/replsets/tags_with_reconfig.js b/jstests/replsets/tags_with_reconfig.js index 60b04f3cf08..d942a8e54d9 100644 --- a/jstests/replsets/tags_with_reconfig.js +++ b/jstests/replsets/tags_with_reconfig.js @@ -31,7 +31,7 @@ replTest.initiate(conf); replTest.awaitReplication(); - var wtimeout = 60 * 1000 * 5; + var wtimeout = ReplSetTest.kDefaultTimeoutMS; var master = replTest.getPrimary(); var db = master.getDB("test"); diff --git a/jstests/replsets/temp_namespace_restart_as_standalone.js b/jstests/replsets/temp_namespace_restart_as_standalone.js index 40752a9d3c6..f681d0a97d1 100644 --- a/jstests/replsets/temp_namespace_restart_as_standalone.js +++ b/jstests/replsets/temp_namespace_restart_as_standalone.js @@ -25,7 +25,7 @@ assert.commandWorked(primaryDB.runCommand({ create: "temp_collection", temp: true, - writeConcern: {w: 2, wtimeout: 60000}, + writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}, })); // Verify that the temporary collection exists on the primary and has temp=true. @@ -80,7 +80,8 @@ // Verify that writes are replicated to the temporary collection and can successfully be applied // by the secondary after having restarted it. - assert.writeOK(primaryDB.temp_collection.insert({}, {writeConcern: {w: 2, wtimeout: 60000}})); + assert.writeOK(primaryDB.temp_collection.insert( + {}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); rst.stopSet(); })(); -- cgit v1.2.1