summaryrefslogtreecommitdiff
path: root/jstests/sharding/commands_that_write_accept_wc_configRS.js
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-06-14 14:09:19 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-06-15 13:27:58 -0400
commit96d35cfa5c3212124e0ffdbdcb81a26565b022e3 (patch)
treed1d2333fc48a8b96e087e2b657efe186de34f6e8 /jstests/sharding/commands_that_write_accept_wc_configRS.js
parent82eeeb07c024422a07d798b8bee59b5d49c2fdd7 (diff)
downloadmongo-96d35cfa5c3212124e0ffdbdcb81a26565b022e3.tar.gz
SERVER-27789 Increase timeouts in commands_that_write_accept_wc_*
Diffstat (limited to 'jstests/sharding/commands_that_write_accept_wc_configRS.js')
-rw-r--r--jstests/sharding/commands_that_write_accept_wc_configRS.js15
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();