Skip to content

Commit

Permalink
SERVER-6834 wait for all stopped nodes to be down in test
Browse files Browse the repository at this point in the history
Wait for all the nodes that we stopped to be seen as { ok : false }
before proceeding to the next part of the test.
  • Loading branch information
Tad Marshall authored and monkey101 committed Sep 12, 2012
1 parent 44634c4 commit 0fb9a7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jstests/sharding/read_pref.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ assert.eq( primaryNode.name, explain.server );
assert.eq( 1, explain.n );

// Kill all members except one
var stoppedNodes = [];
for ( var x = 0; x < NODES - 1; x++ ){
replTest.stop( x );
stoppedNodes.push( replTest.nodes[x] );
}

// Wait for ReplicaSetMonitor to realize nodes are down
ReplSetTest.awaitRSClientHosts( conn, replTest.nodes[0], { ok: false }, replTest.name );
ReplSetTest.awaitRSClientHosts( conn, stoppedNodes, { ok: false }, replTest.name );

// Wait for the last node to be in steady state -> secondary (not recovering)
var lastNode = replTest.nodes[NODES - 1];
Expand Down

0 comments on commit 0fb9a7a

Please sign in to comment.