summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2019-03-08 09:44:11 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2019-03-08 16:26:55 -0500
commitd5614151e3160d7c4d3f61d360ab65ab72eb411c (patch)
tree5ead5ee2cbeeb7232e87e7709217408b101d09c6
parentc0654eacb16ed1ff98d3d7bbf8a9a949a291a9d1 (diff)
downloadmongo-d5614151e3160d7c4d3f61d360ab65ab72eb411c.tar.gz
SERVER-39933 replSetStepDown in continuous_stepdown.js should allow expected error codes
-rw-r--r--jstests/libs/override_methods/continuous_stepdown.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/libs/override_methods/continuous_stepdown.js b/jstests/libs/override_methods/continuous_stepdown.js
index 9fd8668a663..cbd5687dbda 100644
--- a/jstests/libs/override_methods/continuous_stepdown.js
+++ b/jstests/libs/override_methods/continuous_stepdown.js
@@ -77,8 +77,12 @@ let ContinuousStepdown;
while (stopCounter.getCount() > 0) {
print("*** Stepping down " + primary);
- assert.commandWorked(primary.adminCommand(
- {replSetStepDown: options.stepdownDurationSecs, force: true}));
+ // The command may fail if the node is no longer primary or is in the process of
+ // stepping down.
+ assert.commandWorkedOrFailedWithCode(
+ primary.adminCommand(
+ {replSetStepDown: options.stepdownDurationSecs, force: true}),
+ [ErrorCodes.NotMaster, ErrorCodes.ConflictingOperationInProgress]);
// Wait for primary to get elected and allow the test to make some progress
// before attempting another stepdown.