diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-02-18 10:38:43 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-18 20:57:34 +0000 |
commit | f063c183ac04468563fde5405ba9b283306b0c10 (patch) | |
tree | f82cb2e9a4b61d986110f792a4c4f73c96c08aea /jstests/multiVersion | |
parent | 74306a6fd07a7194567f77c930e0dc4e18098df3 (diff) | |
download | mongo-f063c183ac04468563fde5405ba9b283306b0c10.tar.gz |
SERVER-46026 Fix initial_sync_drop_against_last_stable.js with JSON logs
Diffstat (limited to 'jstests/multiVersion')
-rw-r--r-- | jstests/multiVersion/initial_sync_drop_against_last_stable.js | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/jstests/multiVersion/initial_sync_drop_against_last_stable.js b/jstests/multiVersion/initial_sync_drop_against_last_stable.js index e36a2a8606e..bcccaa96fef 100644 --- a/jstests/multiVersion/initial_sync_drop_against_last_stable.js +++ b/jstests/multiVersion/initial_sync_drop_against_last_stable.js @@ -78,7 +78,7 @@ function setupTest({failPoint, extraFailPointData, secondaryStartupParams}) { replTest.waitForState(secondary, ReplSetTest.State.STARTUP_2); } -function finishTest({failPoint, expectedLog, waitForDrop, createNew}) { +function finishTest({failPoint, expectedLog, expectedLogId, waitForDrop, createNew}) { // Get the uuid for use in checking the log line. let uuid = getUUIDFromListCollections(primaryDB, collName); @@ -99,13 +99,24 @@ function finishTest({failPoint, expectedLog, waitForDrop, createNew}) { jsTestLog("Allowing secondary to continue."); assert.commandWorked(secondary.adminCommand({configureFailPoint: failPoint, mode: 'off'})); - if (expectedLog) { - expectedLog = eval(expectedLog); - if (isJsonLog(primaryColl.getMongo())) { - expectedLog = expectedLog.replace(/"/g, "\\\""); + if (isJsonLog(primaryColl.getMongo())) { + if (expectedLogId) { + let attrValues = { + "ns": nss, + "uuid": function(attr) { + return BinData(parseInt(attr.uuid.$binary.subType), attr.uuid.$binary.base64) + .toString() === uuid.toString(); + } + }; + + checkLog.containsJson(secondary, expectedLogId, attrValues); + } + } else { + if (expectedLog) { + expectedLog = eval(expectedLog); + jsTestLog(expectedLog); + checkLog.contains(secondary, expectedLog); } - jsTestLog(expectedLog); - checkLog.contains(secondary, expectedLog); } jsTestLog("Waiting for initial sync to complete."); @@ -148,6 +159,7 @@ runDropTest({ failPoint: "initialSyncHangCollectionClonerAfterHandlingBatchResponse", secondaryStartupParams: {collectionClonerBatchSize: 1}, waitForDrop: true, + expectedLogId: 21132, expectedLog: "`CollectionCloner ns: '${nss}' uuid: ${uuid} stopped because collection was dropped on source.`" }); @@ -158,6 +170,7 @@ runDropTest({ failPoint: "initialSyncHangCollectionClonerAfterHandlingBatchResponse", secondaryStartupParams: {collectionClonerBatchSize: 1}, waitForDrop: true, + expectedLogId: 21132, expectedLog: "`CollectionCloner ns: '${nss}' uuid: ${uuid} stopped because collection was dropped on source.`", createNew: true |