diff options
author | Xuerui Fa <xuerui.fa@mongodb.com> | 2020-05-29 12:04:48 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-20 13:59:01 +0000 |
commit | ff1ff7df0e2c30b2c52030465ef5fbc7e31e90c1 (patch) | |
tree | c0e995841e56c0abde229695c137869b1cc69035 | |
parent | 92659d7ae96eb88b22c1a8614b9ac6f638acb1af (diff) | |
download | mongo-ff1ff7df0e2c30b2c52030465ef5fbc7e31e90c1.tar.gz |
SERVER-48107: Retry replSetStepDown in rollback_test.js
(cherry picked from commit 5edffc61e61b004811d7cde7728d9908aff4acc5)
-rw-r--r-- | jstests/replsets/libs/rollback_test.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js index 2f728f6c053..b3b8589ed27 100644 --- a/jstests/replsets/libs/rollback_test.js +++ b/jstests/replsets/libs/rollback_test.js @@ -440,7 +440,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); |