diff options
author | Greg Studer <greg@10gen.com> | 2013-05-17 10:30:22 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2013-05-22 16:44:09 -0400 |
commit | 69f84b299776ec2f8b0ae29b95e82f6baf20fa3b (patch) | |
tree | 3ce37abdd2aa391468a86dc600d7daff22e3a43e | |
parent | 20528eed9458f5ea5decd8aa7c0a4760a910c66d (diff) | |
download | mongo-69f84b299776ec2f8b0ae29b95e82f6baf20fa3b.tar.gz |
SERVER-9719 sharding_multiple_ns_rs.js wait for mongos to detect primary failover
-rw-r--r-- | jstests/slowNightly/sharding_multiple_ns_rs.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jstests/slowNightly/sharding_multiple_ns_rs.js b/jstests/slowNightly/sharding_multiple_ns_rs.js index f16d4de1ead..9c4d73d5a2c 100644 --- a/jstests/slowNightly/sharding_multiple_ns_rs.js +++ b/jstests/slowNightly/sharding_multiple_ns_rs.js @@ -29,7 +29,11 @@ s._rs[0].test.awaitReplication(); s._rs[0].test.stopMaster( 15 , true ) -sleep( (20 + 10 + 5) * 1000 ); // Need to sleep ~20s for replica set failover in worst case, then ~10s for mongos to detect +// Wait for the primary to come back online... +var primary = s._rs[0].test.getPrimary(); + +// Wait for the mongos to recognize the new primary... +ReplSetTest.awaitRSClientHosts( db.getMongo(), primary, { ismaster : true } ); assert.eq( 5 , db.foo.findOne( { _id : 5 } ).x ); assert.eq( 5 , db.bar.findOne( { _id : 5 } ).x ); |