diff options
author | Spencer T Brody <spencer@mongodb.com> | 2016-09-29 14:33:08 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2017-04-21 11:24:33 -0400 |
commit | f2dfe69b624200950fc780c3afdaac74d63a557f (patch) | |
tree | eaf814849b25f5570f52c0db3deefc52085c31f8 /jstests | |
parent | 6b4ed4753d7cb49b610ae9a8a68a91ed4560cf93 (diff) | |
download | mongo-f2dfe69b624200950fc780c3afdaac74d63a557f.tar.gz |
SERVER-26381 Increase timeout for waiting for node to become primary in priority_takeover_cascading_priorities.js
(cherry picked from commit ed355c631bd460cbd75f50e18d71f7df37b00bfe)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/replsets/priority_takeover_cascading_priorities.js | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/jstests/replsets/priority_takeover_cascading_priorities.js b/jstests/replsets/priority_takeover_cascading_priorities.js index df119abb669..e210d250f10 100644 --- a/jstests/replsets/priority_takeover_cascading_priorities.js +++ b/jstests/replsets/priority_takeover_cascading_priorities.js @@ -21,25 +21,15 @@ replSet.startSet(); replSet.initiate(); - var waitForPrimary = function(i) { - // Refresh connections to nodes. - replSet.status(); - assert.commandWorked( - replSet.nodes[i].adminCommand({ - replSetTest: 1, - waitForMemberState: ReplSetTest.State.PRIMARY, - timeoutMillis: 60 * 1000, - }), - 'node ' + i + ' ' + replSet.nodes[i].host + ' failed to become primary'); - }; - - waitForPrimary(0); + replSet.waitForState(0, ReplSetTest.State.PRIMARY); + // Wait until all nodes get the "no-op" of "new primary" after initial sync. + waitUntilAllNodesCaughtUp(replSet.nodes); replSet.stop(0); - waitForPrimary(1); + replSet.waitForState(1, ReplSetTest.State.PRIMARY); replSet.stop(1); - waitForPrimary(2); + replSet.waitForState(2, ReplSetTest.State.PRIMARY); // Cannot stop any more nodes because we will not have a majority. })(); |