summaryrefslogtreecommitdiff
path: root/jstests/replsets
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2017-10-11 10:47:28 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2017-10-12 09:59:05 -0400
commit5c7a7ca7ec6fc123882e0feed80d95c3431a47f5 (patch)
treef086868a6e2e89ed28c78e8f6cff84b6181af33c /jstests/replsets
parentc7286b34045fcf8c4b3d8b7d1c275a708f671ee5 (diff)
downloadmongo-5c7a7ca7ec6fc123882e0feed80d95c3431a47f5.tar.gz
SERVER-31512 Use awaitNodesAgreeOnPrimary instead of waitForState in replsetprio1.js to improve robustness of test.
Diffstat (limited to 'jstests/replsets')
-rw-r--r--jstests/replsets/replsetprio1.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/replsets/replsetprio1.js b/jstests/replsets/replsetprio1.js
index 5aee0a33a92..e77ed94b254 100644
--- a/jstests/replsets/replsetprio1.js
+++ b/jstests/replsets/replsetprio1.js
@@ -16,7 +16,8 @@
});
// 2 should be master (give this a while to happen, as other nodes might first be elected)
- replTest.waitForState(nodes[2], ReplSetTest.State.PRIMARY);
+ replTest.awaitNodesAgreeOnPrimary(replTest.kDefaultTimeoutMS, nodes, 2);
+
// 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);
@@ -42,7 +43,7 @@
// bring 2 back up, 2 should wait until caught up and then become master
replTest.restart(2);
- replTest.waitForState(nodes[2], ReplSetTest.State.PRIMARY);
+ replTest.awaitNodesAgreeOnPrimary(replTest.kDefaultTimeoutMS, nodes, 2);
// make sure nothing was rolled back
master = replTest.getPrimary();