diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-06-14 14:09:19 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-06-15 13:31:52 -0400 |
commit | 2da98515dc96a8e9ae329200fc251db66f893ac0 (patch) | |
tree | 1da2e9cfc262089254c67ac604316ec1834c6855 | |
parent | dad8a41d24e86a5b1c4dd9cc73aeede87f05ad74 (diff) | |
download | mongo-2da98515dc96a8e9ae329200fc251db66f893ac0.tar.gz |
SERVER-27789 Increase timeouts in commands_that_write_accept_wc_*
-rw-r--r-- | jstests/replsets/commands_that_write_accept_wc.js | 3 | ||||
-rw-r--r-- | jstests/sharding/commands_that_write_accept_wc_configRS.js | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/jstests/replsets/commands_that_write_accept_wc.js b/jstests/replsets/commands_that_write_accept_wc.js index 64e52d4c6c6..87327cdadea 100644 --- a/jstests/replsets/commands_that_write_accept_wc.js +++ b/jstests/replsets/commands_that_write_accept_wc.js @@ -21,6 +21,7 @@ load('jstests/libs/write_concern_util.js'); var coll = db[collName]; function dropTestCollection() { + replTest.awaitReplication(); coll.drop(); assert.eq(0, coll.find().itcount(), "test collection not empty"); } @@ -118,7 +119,7 @@ load('jstests/libs/write_concern_util.js'); }); function testValidWriteConcern(cmd) { - cmd.req.writeConcern = {w: 'majority', wtimeout: 25000}; + cmd.req.writeConcern = {w: 'majority', wtimeout: ReplSetTest.kDefaultTimeoutMS}; jsTest.log("Testing " + tojson(cmd.req)); dropTestCollection(); diff --git a/jstests/sharding/commands_that_write_accept_wc_configRS.js b/jstests/sharding/commands_that_write_accept_wc_configRS.js index a864691dee0..cd1e6c93e9b 100644 --- a/jstests/sharding/commands_that_write_accept_wc_configRS.js +++ b/jstests/sharding/commands_that_write_accept_wc_configRS.js @@ -33,6 +33,9 @@ load('jstests/multiVersion/libs/auth_helpers.js'); var counter = 0; function dropTestData() { + st.configRS.awaitReplication(); + st.rs0.awaitReplication(); + st.rs1.awaitReplication(); db.dropUser('username'); db.dropUser('user1'); localDB.dropUser('user2'); @@ -201,7 +204,10 @@ load('jstests/multiVersion/libs/auth_helpers.js'); if (cmd.runsOnShards) { if (cmd.failsOnShards) { // This command fails when there is a writeConcernError on the shards. - req.writeConcern.wtimeout = 3000; + // We set the timeout high enough that the command should not time out against the + // config server, but not exorbitantly high, because it will always time out against + // shards and so will increase the runtime of this test. + req.writeConcern.wtimeout = 15 * 1000; res = runCommandCheckAdmin(db, cmd); restartReplicationOnAllShards(st); assert.commandFailed(res); @@ -212,7 +218,10 @@ load('jstests/multiVersion/libs/auth_helpers.js'); } else { // This command passes and returns a writeConcernError when there is a // writeConcernError on the shards. - req.writeConcern.wtimeout = 3000; + // We set the timeout high enough that the command should not time out against the + // config server, but not exorbitantly high, because it will always time out against + // shards and so will increase the runtime of this test. + req.writeConcern.wtimeout = 15 * 1000; res = runCommandCheckAdmin(db, cmd); restartReplicationOnAllShards(st); assert.commandWorked(res); @@ -237,7 +246,7 @@ load('jstests/multiVersion/libs/auth_helpers.js'); var setupFunc = cmd.setupFunc; var confirmFunc = cmd.confirmFunc; - req.writeConcern = {w: 'majority', wtimeout: 25000}; + req.writeConcern = {w: 'majority', wtimeout: ReplSetTest.kDefaultTimeoutMS}; jsTest.log("Testing " + tojson(req)); dropTestData(); |