diff options
Diffstat (limited to 'jstests/replsets/election_handoff_flip.js')
-rw-r--r-- | jstests/replsets/election_handoff_flip.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/jstests/replsets/election_handoff_flip.js b/jstests/replsets/election_handoff_flip.js index 6e6c6f7bd66..c2576023048 100644 --- a/jstests/replsets/election_handoff_flip.js +++ b/jstests/replsets/election_handoff_flip.js @@ -4,24 +4,26 @@ */ (function() { - "use strict"; - load("jstests/replsets/libs/election_handoff.js"); +"use strict"; +load("jstests/replsets/libs/election_handoff.js"); - const testName = "election_handoff_flip"; - const numNodes = 2; - const rst = ReplSetTest({name: testName, nodes: numNodes}); - const nodes = rst.nodeList(); - rst.startSet(); +const testName = "election_handoff_flip"; +const numNodes = 2; +const rst = ReplSetTest({name: testName, nodes: numNodes}); +const nodes = rst.nodeList(); +rst.startSet(); - // Make sure there are no election timeouts firing for the duration of the test. This helps - // ensure that the test will only pass if the election handoff succeeds. - const config = rst.getReplSetConfig(); - config.settings = {"electionTimeoutMillis": 12 * 60 * 60 * 1000}; - rst.initiate(config); +// Make sure there are no election timeouts firing for the duration of the test. This helps +// ensure that the test will only pass if the election handoff succeeds. +const config = rst.getReplSetConfig(); +config.settings = { + "electionTimeoutMillis": 12 * 60 * 60 * 1000 +}; +rst.initiate(config); - ElectionHandoffTest.testElectionHandoff(rst, 0, 1); - sleep(ElectionHandoffTest.stepDownPeriodSecs * 1000); - ElectionHandoffTest.testElectionHandoff(rst, 1, 0); +ElectionHandoffTest.testElectionHandoff(rst, 0, 1); +sleep(ElectionHandoffTest.stepDownPeriodSecs * 1000); +ElectionHandoffTest.testElectionHandoff(rst, 1, 0); - rst.stopSet(); +rst.stopSet(); })();
\ No newline at end of file |