summaryrefslogtreecommitdiff
path: root/jstests/replsets/reconfig_during_election.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/reconfig_during_election.js')
-rw-r--r--jstests/replsets/reconfig_during_election.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/jstests/replsets/reconfig_during_election.js b/jstests/replsets/reconfig_during_election.js
index 20e67a483c8..86cc5006d91 100644
--- a/jstests/replsets/reconfig_during_election.js
+++ b/jstests/replsets/reconfig_during_election.js
@@ -4,8 +4,8 @@
(function() {
"use strict";
+load("jstests/libs/fail_point_util.js");
load("jstests/replsets/libs/election_handoff.js");
-load("jstests/libs/check_log.js");
const rst = ReplSetTest({nodes: 2});
const nodes = rst.startSet();
@@ -22,11 +22,8 @@ const candidate = rst.getSecondary();
jsTestLog("Step down");
-assert.commandWorked(candidate.adminCommand({
- configureFailPoint: "electionHangsBeforeUpdateMemberState",
- mode: "alwaysOn",
- data: {waitForMillis: 10 * 1000}
-}));
+const failPoint = configureFailPoint(
+ candidate, "electionHangsBeforeUpdateMemberState", {waitForMillis: 10 * 1000});
// The incumbent sends replSetStepUp to the candidate for election handoff.
assert.commandWorked(incumbent.adminCommand({
@@ -36,8 +33,7 @@ assert.commandWorked(incumbent.adminCommand({
jsTestLog("Wait for candidate to win the election");
-checkLog.contains(candidate,
- "election succeeded - electionHangsBeforeUpdateMemberState fail point enabled");
+failPoint.wait();
jsTestLog("Try to interrupt it with a reconfig");
@@ -45,8 +41,7 @@ config.members[nodes.indexOf(candidate)].priority = 2;
config.version++;
assert.commandWorked(candidate.adminCommand({replSetReconfig: config, force: true}));
-assert.commandWorked(candidate.adminCommand(
- {configureFailPoint: "electionHangsBeforeUpdateMemberState", mode: "off"}));
+failPoint.off();
rst.stopSet();
})();