summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2013-05-14 14:55:58 -0400
committerEric Milkie <milkie@10gen.com>2013-05-14 14:56:36 -0400
commit36541662e167d5c8b5be7a6f8cc91b3a2230b251 (patch)
tree42ac36f0cc4aaefc4383d03ee391c29637e8b880
parentc9cc631ac964aafd5c951ae61e2eb09920be1d81 (diff)
downloadmongo-36541662e167d5c8b5be7a6f8cc91b3a2230b251.tar.gz
SERVER-9683 propegate timeout into ReplSetTest.initiate() and make replsetprio1.js wait longer
-rw-r--r--jstests/replsets/replsetprio1.js10
-rw-r--r--src/mongo/shell/replsettest.js8
2 files changed, 10 insertions, 8 deletions
diff --git a/jstests/replsets/replsetprio1.js b/jstests/replsets/replsetprio1.js
index 218bbc04314..40d7786bac1 100644
--- a/jstests/replsets/replsetprio1.js
+++ b/jstests/replsets/replsetprio1.js
@@ -7,10 +7,12 @@ doTest = function( signal ) {
replTest.startSet();
replTest.initiate({"_id" : "testSet",
- "members" : [
- {"_id" : 0, "host" : nodes[0], "priority" : 1},
- {"_id" : 1, "host" : nodes[1], "priority" : 2},
- {"_id" : 2, "host" : nodes[2], "priority" : 3}]});
+ "members" : [
+ {"_id" : 0, "host" : nodes[0], "priority" : 1},
+ {"_id" : 1, "host" : nodes[1], "priority" : 2},
+ {"_id" : 2, "host" : nodes[2], "priority" : 3}]},
+ 'replSetInitiate',
+ 80000);
// 2 should be master (give this a while to happen, as 0 will be elected, then demoted)
assert.soon(function() {
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 1ca47130df7..a9c8c36b050 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -380,7 +380,7 @@ ReplSetTest.awaitRSClientHosts = function( conn, host, hostOk, rs ) {
}
ReplSetTest.prototype.awaitSecondaryNodes = function( timeout ) {
- this.getMaster(); // Wait for a primary to be selected.
+ this.getMaster(timeout); // Wait for a primary to be selected.
var tmo = timeout || 60000;
var replTest = this;
assert.soon(
@@ -469,17 +469,17 @@ ReplSetTest.prototype.initiate = function( cfg , initCmd , timeout ) {
var config = cfg || this.getReplSetConfig();
var cmd = {};
var cmdKey = initCmd || 'replSetInitiate';
- var timeout = timeout || 30000;
+ var tmo = timeout || 30000;
cmd[cmdKey] = config;
printjson(cmd);
- jsTest.attempt({context:this, timeout: timeout, desc: "Initiate replica set"}, function() {
+ jsTest.attempt({context:this, timeout: tmo, desc: "Initiate replica set"}, function() {
var result = master.runCommand(cmd);
printjson(result);
return result['ok'] == 1;
});
- this.awaitSecondaryNodes();
+ this.awaitSecondaryNodes(timeout);
// Setup authentication if running test with authentication
if (jsTestOptions().keyFile && !this.keyFile) {