diff options
-rw-r--r-- | jstests/replsets/last_vote.js | 2 | ||||
-rw-r--r-- | jstests/replsets/slave_delay_clean_shutdown.js | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/jstests/replsets/last_vote.js b/jstests/replsets/last_vote.js index 44d349f3237..12f13493f08 100644 --- a/jstests/replsets/last_vote.js +++ b/jstests/replsets/last_vote.js @@ -113,6 +113,8 @@ jsTestLog("Restarting node 0 in replica set mode"); node0 = rst.restart(0); // Restart in replSet mode again. + rst.waitForState(node0, ReplSetTest.State.SECONDARY); + assert.soonNoExcept(function() { assertCurrentTerm(node0, term); return true; diff --git a/jstests/replsets/slave_delay_clean_shutdown.js b/jstests/replsets/slave_delay_clean_shutdown.js index fe5b9e62164..80371048b6b 100644 --- a/jstests/replsets/slave_delay_clean_shutdown.js +++ b/jstests/replsets/slave_delay_clean_shutdown.js @@ -56,6 +56,8 @@ load('jstests/replsets/rslib.js'); assert.lt(Date.timeFunc(() => rst.stop(1)), 60 * 1000); secondary = rst.restart(1); + rst.awaitSecondaryNodes(); + assert.eq(getLatestOp(secondary), lastOp); sleep(2000); // Prevent the test from passing by chance. assert.eq(getLatestOp(secondary), lastOp); |