diff --git a/jstests/replsets/drop_collections_two_phase_rename_drop_target.js b/jstests/replsets/drop_collections_two_phase_rename_drop_target.js index 51240192e96..5a76ec8de8d 100644 --- a/jstests/replsets/drop_collections_two_phase_rename_drop_target.js +++ b/jstests/replsets/drop_collections_two_phase_rename_drop_target.js @@ -6,6 +6,7 @@ (function() { 'use strict'; +load("jstests/libs/logv2_helpers.js"); load('jstests/replsets/libs/two_phase_drops.js'); // For TwoPhaseDropCollectionTest. // Return a list of all indexes for a given collection. Use 'args' as the @@ -103,7 +104,11 @@ try { // Confirm in the logs that the renameCollection dropped the target collection on the // secondary using two phase collection drop. - checkLog.contains(secondary, new RegExp('dropCollection:.*' + toColl.getFullName())); + if (isJsonLog(secondary)) { + checkLog.containsJson(secondary, 20315, {nss: toColl.getFullName()}); + } else { + checkLog.contains(secondary, new RegExp('dropCollection:.*' + toColl.getFullName())); + } // Rename target collection back to source collection. This helps to ensure the collection // metadata is updated correctly on both primary and secondary.