summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuerui Fa <xuerui.fa@mongodb.com>2020-05-29 12:04:48 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-01 21:35:40 +0000
commita3b551b01c186963e4dd33477277c6aa614eb883 (patch)
treef29ae3385b3643ba8245965c3c17e86988cccb75
parent04f1978c864a9bdb000129c1e79eb990fecf3514 (diff)
downloadmongo-a3b551b01c186963e4dd33477277c6aa614eb883.tar.gz
SERVER-48107: Retry replSetStepDown in rollback_test.js
(cherry picked from commit 5edffc61e61b004811d7cde7728d9908aff4acc5)
-rw-r--r--jstests/replsets/libs/rollback_test.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js
index 7fa8fffc46d..7c9a6f88088 100644
--- a/jstests/replsets/libs/rollback_test.js
+++ b/jstests/replsets/libs/rollback_test.js
@@ -299,7 +299,10 @@ function RollbackTest(name = "RollbackTest", replSet) {
try {
// The stepdown freeze period is short because the node is disconnected from
// the rest of the replica set, so it physically can't become the primary.
- curPrimary.adminCommand({replSetStepDown: 1, force: true});
+ assert.soon(() => {
+ const res = curPrimary.adminCommand({replSetStepDown: 1, force: true});
+ return (res.ok || res.code === ErrorCodes.NotMaster);
+ });
} catch (e) {
// Stepdown may fail if the node has already started stepping down.
print('Caught exception from replSetStepDown: ' + e);