diff options
author | Greg Studer <greg@10gen.com> | 2013-05-17 10:30:22 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2013-05-17 10:30:22 -0400 |
commit | 7147f38909978e83f290a31a0b5833b097bab5db (patch) | |
tree | ba7151ebb7e7e54a05ebaedae2bdee7b823a4220 | |
parent | d5bb16f175a21e45b6a97a3840372df30750396b (diff) | |
download | mongo-7147f38909978e83f290a31a0b5833b097bab5db.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 ); |