diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2017-04-14 14:54:40 -0400 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2017-04-14 14:54:52 -0400 |
commit | dbee67bcd50a838d0a12cfcce2040479cb6fe2b8 (patch) | |
tree | 0fab6aafb9fa890ba3876df549c222a1518b3c1e | |
parent | dc2e2b281bf7bc89de73c9bb7bf8d587ba40291c (diff) | |
download | mongo-dbee67bcd50a838d0a12cfcce2040479cb6fe2b8.tar.gz |
SERVER-28192 priority_takeover_one_node_higher_priority jstest needs longer stepDownGuard
-rw-r--r-- | jstests/replsets/priority_takeover_one_node_higher_priority.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/jstests/replsets/priority_takeover_one_node_higher_priority.js b/jstests/replsets/priority_takeover_one_node_higher_priority.js index 1d9aafb08e7..3059ea2cd00 100644 --- a/jstests/replsets/priority_takeover_one_node_higher_priority.js +++ b/jstests/replsets/priority_takeover_one_node_higher_priority.js @@ -27,19 +27,19 @@ // Primary should step down long enough for election to occur on secondary. var config = assert.commandWorked(primary.adminCommand({replSetGetConfig: 1})).config; - var electionTimeoutMillis = config.settings.electionTimeoutMillis; - var stepDownGuardMillis = electionTimeoutMillis * 2; var stepDownException = assert.throws(function() { - var result = primary.adminCommand({replSetStepDown: stepDownGuardMillis / 1000}); + var result = primary.adminCommand({replSetStepDown: replSet.kDefaultTimeoutMS / 1000}); print('replSetStepDown did not throw exception but returned: ' + tojson(result)); }); assert(isNetworkError(stepDownException), 'replSetStepDown did not disconnect client; failed with ' + tojson(stepDownException)); // Step down primary and wait for node 1 to be promoted to primary. - replSet.waitForState(replSet.nodes[1], ReplSetTest.State.PRIMARY, 60 * 1000); + replSet.waitForState(replSet.nodes[1], ReplSetTest.State.PRIMARY); + + // Unfreeze node 0 so it can seek election. + assert.commandWorked(primary.adminCommand({replSetFreeze: 0})); // Eventually node 0 will stand for election again because it has a higher priorty. - replSet.waitForState( - replSet.nodes[0], ReplSetTest.State.PRIMARY, stepDownGuardMillis + 60 * 1000); + replSet.waitForState(replSet.nodes[0], ReplSetTest.State.PRIMARY); })(); |