summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2014-04-04 08:53:38 -0400
committerMatt Kangas <matt.kangas@mongodb.com>2014-04-09 18:54:21 -0400
commitd2030ec6797f4d4238e03690eef8334c1f582ce2 (patch)
treefa3c892b5890fd9d3b51b6ab7f8a21218253f447
parent1bdf9bb5115bdc993828dc9addc27dd8e4488e1b (diff)
downloadmongo-d2030ec6797f4d4238e03690eef8334c1f582ce2.tar.gz
SERVER-13507 increased stability of stepdown_wrt_electable.js by altering its use of parallel shells
(cherry picked from commit 8784c38f824b9666dd3c68b80cd6069ef2970694)
-rw-r--r--jstests/replsets/stepdown_wrt_electable.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/jstests/replsets/stepdown_wrt_electable.js b/jstests/replsets/stepdown_wrt_electable.js
index 3d21a74f67c..85f32071b91 100644
--- a/jstests/replsets/stepdown_wrt_electable.js
+++ b/jstests/replsets/stepdown_wrt_electable.js
@@ -19,20 +19,22 @@ replTest.awaitReplication();
// stepdown should fail since there is no-one to elect within 10 secs
testDB.adminCommand({replSetStepDown:5});
-assert(new Mongo(firstPrimary).getDB("a").isMaster().ismaster, "not master")
+assert(master.getDB("a").isMaster().ismaster, "not master")
// step down the primary asyncronously so it doesn't kill this test
-var command = "tojson(db.adminCommand({replSetStepDown:1000, force:true}));"
-// set db so startParallelShell works
-db = testDB;
-var waitfunc = startParallelShell(command);
-sleep(100) // startParallelShell doesn't block
+var wait = startParallelShell("db.adminCommand({replSetStepDown:1000, force:true})", master.port);
+wait();
// check that the old primary is no longer master
assert.soon( function() {
- var isMaster = new Mongo(firstPrimary).getDB("a").isMaster();
- printjson(isMaster);
- return !(isMaster.ismaster);
+ try {
+ var isMaster = master.getDB("a").isMaster();
+ printjson(isMaster);
+ return !(isMaster.ismaster);
+ } catch (e) {
+ return false;
+ }
}, "they shouldn't be master, but are")
+
// stop
replTest.stopSet();