diff options
-rw-r--r-- | jstests/replsets/stepup.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/replsets/stepup.js b/jstests/replsets/stepup.js index 4c5d20d42c4..aeffcc37e58 100644 --- a/jstests/replsets/stepup.js +++ b/jstests/replsets/stepup.js @@ -38,7 +38,9 @@ load('jstests/replsets/libs/election_metrics.js'); // Step up the secondary. Retry since the old primary may step down when we try to ask for its // vote. + let numStepUpCmds = 0; assert.soonNoExcept(function() { + numStepUpCmds++; return secondary.adminCommand({replSetStepUp: 1}).ok; }); @@ -50,8 +52,10 @@ load('jstests/replsets/libs/election_metrics.js'); // Check that both the 'called' and 'successful' fields of stepUpCmd have been incremented in // serverStatus, and that they have not been incremented in any of the other election reason // counters. - verifyServerStatusElectionReasonCounterChange( - initialSecondaryStatus.electionMetrics, newSecondaryStatus.electionMetrics, "stepUpCmd", 1); + verifyServerStatusElectionReasonCounterChange(initialSecondaryStatus.electionMetrics, + newSecondaryStatus.electionMetrics, + "stepUpCmd", + numStepUpCmds); verifyServerStatusElectionReasonCounterChange(initialSecondaryStatus.electionMetrics, newSecondaryStatus.electionMetrics, "priorityTakeover", |