diff options
author | Matthew Russotto <matthew.russotto@mongodb.com> | 2021-09-10 12:34:18 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-05 14:22:00 +0000 |
commit | 882849fe205ea0b1e22557c228da64a8492cc110 (patch) | |
tree | 9023dae4968d6335c21123ac2762eb385ee133d2 | |
parent | 116e5b8e47a90bbc5a892bd071b1b23295d13c58 (diff) | |
download | mongo-882849fe205ea0b1e22557c228da64a8492cc110.tar.gz |
SERVER-59871 startup_recovery_for_restore_restarts.js needs to make sure a checkpoint happens after failpoint
-rw-r--r-- | jstests/replsets/startup_recovery_for_restore_restarts.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/jstests/replsets/startup_recovery_for_restore_restarts.js b/jstests/replsets/startup_recovery_for_restore_restarts.js index ce7281d094c..648696a0296 100644 --- a/jstests/replsets/startup_recovery_for_restore_restarts.js +++ b/jstests/replsets/startup_recovery_for_restore_restarts.js @@ -128,16 +128,15 @@ rst.start(restoreNode, }) }, true /* restart */); - -let fpMatchIndex; assert.soon(() => { // Can't use checklog because we can't connect to the mongo in startup mode. - fpMatchIndex = rawMongoProgramOutput().search("hangAfterCollectionInserts fail point enabled"); - return fpMatchIndex !== -1; + return rawMongoProgramOutput().search("hangAfterCollectionInserts fail point enabled") !== -1; }); +// We need to make sure we get a checkpoint after the failpoint is hit, so we clear the output after +// hitting it. Occasionally we'll miss a checkpoint as a result of clearing the output, but we'll +// get another one a second later. +clearRawMongoProgramOutput(); assert.soon(() => { - // Specifically wait for an unstable checkpoint to be taken after we hit the - // 'hangAfterCollectionInserts' failpoint. - return rawMongoProgramOutput().search("Completed unstable checkpoint.") > fpMatchIndex; + return rawMongoProgramOutput().search("Completed unstable checkpoint.") !== -1; }); jsTestLog("Restarting restore node uncleanly"); |