diff options
-rw-r--r-- | jstests/replsets/replsetprio1.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/replsets/replsetprio1.js b/jstests/replsets/replsetprio1.js index 8b0c6b1cf64..16beb851b81 100644 --- a/jstests/replsets/replsetprio1.js +++ b/jstests/replsets/replsetprio1.js @@ -15,8 +15,11 @@ ] }); - // 2 should be master (give this a while to happen, as 0 will be elected, then demoted) + // 2 should be master (give this a while to happen, as other nodes might first be elected) replTest.waitForState(nodes[2], ReplSetTest.State.PRIMARY, 120000); + // wait for 1 to not appear to be master (we are about to make it master and need a clean slate + // here) + replTest.waitForState(nodes[1], ReplSetTest.State.SECONDARY, 60000); // Wait for election oplog entry to be replicated, to ensure 0 will vote for 1 after stopping 2. replTest.awaitReplication(); |