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:27:58 -0400 |
commit | 96d35cfa5c3212124e0ffdbdcb81a26565b022e3 (patch) | |
tree | d1d2333fc48a8b96e087e2b657efe186de34f6e8 /jstests/sharding | |
parent | 82eeeb07c024422a07d798b8bee59b5d49c2fdd7 (diff) | |
download | mongo-96d35cfa5c3212124e0ffdbdcb81a26565b022e3.tar.gz |
SERVER-27789 Increase timeouts in commands_that_write_accept_wc_*
Diffstat (limited to 'jstests/sharding')
-rw-r--r-- | jstests/sharding/commands_that_write_accept_wc_configRS.js | 15 |
1 files changed, 12 insertions, 3 deletions
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(); |