summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2016-09-22 15:33:27 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2016-09-22 15:33:32 -0400
commit0a23acfda08840db5599d715493cf20ab80b0e89 (patch)
tree28550c49e03e8b251dcfea5009ae77dffa5db42f
parentc080a9b3f208ff3e2530e1a3ff543ff526f91728 (diff)
downloadmongo-0a23acfda08840db5599d715493cf20ab80b0e89.tar.gz
SERVER-26256 increase assert.soon() timeout in mongos_no_replica_set_refresh.js to 5 minutes
-rw-r--r--jstests/sharding/mongos_no_replica_set_refresh.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/jstests/sharding/mongos_no_replica_set_refresh.js b/jstests/sharding/mongos_no_replica_set_refresh.js
index c7ea303d953..c6a8a1e05b0 100644
--- a/jstests/sharding/mongos_no_replica_set_refresh.js
+++ b/jstests/sharding/mongos_no_replica_set_refresh.js
@@ -4,6 +4,8 @@ load("jstests/replsets/rslib.js");
(function() {
'use strict';
+ var five_minutes = 5 * 60 * 1000;
+
var numRSHosts = function() {
var result = assert.commandWorked(rsObj.nodes[0].adminCommand({ismaster: 1}));
return result.hosts.length + result.passives.length;
@@ -24,6 +26,9 @@ load("jstests/replsets/rslib.js");
jsTest.log("Waiting for the shard to discover that it now has " + expectedNumHosts +
" hosts.");
var numHostsSeenByShard;
+
+ // Use a high timeout (5 minutes) because replica set refreshes are only done every 30
+ // seconds.
assert.soon(
function() {
numHostsSeenByShard = numRSHosts();
@@ -32,11 +37,15 @@ load("jstests/replsets/rslib.js");
function() {
return ("Expected shard to see " + expectedNumHosts + " hosts but found " +
numHostsSeenByShard);
- });
+ },
+ five_minutes);
jsTest.log("Waiting for the mongos to discover that the shard now has " + expectedNumHosts +
" hosts.");
var numHostsSeenByMongos;
+
+ // Use a high timeout (5 minutes) because replica set refreshes are only done every 30
+ // seconds.
assert.soon(
function() {
numHostsSeenByMongos = numMongosHosts();
@@ -45,7 +54,8 @@ load("jstests/replsets/rslib.js");
function() {
return ("Expected mongos to see " + expectedNumHosts +
" hosts on shard but found " + numHostsSeenByMongos);
- });
+ },
+ five_minutes);
};
var st = new ShardingTest({