diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/shell/check_log.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/shell/check_log.js b/src/mongo/shell/check_log.js index fe2712e9d9d..fc74d871cc1 100644 --- a/src/mongo/shell/check_log.js +++ b/src/mongo/shell/check_log.js @@ -121,6 +121,18 @@ checkLog = (function() { }; /* + * Similar to checkContainsWithCountJson, but checks whether there are at least 'expectedCount' + * instances of 'id' in the logs. + */ + const checkContainsWithAtLeastCountJson = function( + conn, id, attrsDict, expectedCount, severity = null, isRelaxed = false, context = null) { + return checkContainsWithCountJson( + conn, id, attrsDict, expectedCount, severity, isRelaxed, (actual, expected) => { + return actual >= expected; + }, context); + }; + + /* * Calls the 'getLog' function on the provided connection 'conn' to see if a log with the * provided id is found in the logs. If the id is found it looks up the specified attrribute by * attrName and checks if the msg is found in its value. Note: this function does not throw an @@ -401,6 +413,7 @@ checkLog = (function() { checkContainsOnce: checkContainsOnce, checkContainsOnceJson: checkContainsOnceJson, checkContainsWithCountJson: checkContainsWithCountJson, + checkContainsWithAtLeastCountJson: checkContainsWithAtLeastCountJson, checkContainsOnceJsonStringMatch: checkContainsOnceJsonStringMatch, contains: contains, containsJson: containsJson, |