diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2019-03-08 09:44:11 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2019-03-08 16:26:55 -0500 |
commit | d5614151e3160d7c4d3f61d360ab65ab72eb411c (patch) | |
tree | 5ead5ee2cbeeb7232e87e7709217408b101d09c6 | |
parent | c0654eacb16ed1ff98d3d7bbf8a9a949a291a9d1 (diff) | |
download | mongo-d5614151e3160d7c4d3f61d360ab65ab72eb411c.tar.gz |
SERVER-39933 replSetStepDown in continuous_stepdown.js should allow expected error codes
-rw-r--r-- | jstests/libs/override_methods/continuous_stepdown.js | 8 |
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. |