diff options
author | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-10-02 18:34:01 -0400 |
---|---|---|
committer | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-10-25 17:34:53 -0400 |
commit | 66434ba0a7930efedbe5e06a098ab8e7bb659cfa (patch) | |
tree | 8a80b45a5e1f98ee50323080339611dea113106d /jstests/libs/check_log.js | |
parent | bbed82c28f1a06842c30cfcbe7b87cb81a1bc9c4 (diff) | |
download | mongo-66434ba0a7930efedbe5e06a098ab8e7bb659cfa.tar.gz |
SERVER-32146 Log slow oplog entry application
Diffstat (limited to 'jstests/libs/check_log.js')
-rw-r--r-- | jstests/libs/check_log.js | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/jstests/libs/check_log.js b/jstests/libs/check_log.js index ee05375b7c6..8977ce95223 100644 --- a/jstests/libs/check_log.js +++ b/jstests/libs/check_log.js @@ -29,23 +29,19 @@ var checkLog; * the provided 'msg' is found in the logs, or 5 minutes have elapsed. Throws an exception * on timeout. */ - var contains = function(conn, msg) { - assert.soon( - function() { - var logMessages = getGlobalLog(conn); - if (logMessages === null) { - return false; - } - for (var i = 0; i < logMessages.length; i++) { - if (logMessages[i].indexOf(msg) != -1) { - return true; - } - } + var contains = function(conn, msg, timeout = 5 * 60 * 1000) { + assert.soon(function() { + var logMessages = getGlobalLog(conn); + if (logMessages === null) { return false; - }, - 'Could not find log entries containing the following message: ' + msg, - 5 * 60 * 1000, - 300); + } + for (var i = 0; i < logMessages.length; i++) { + if (logMessages[i].indexOf(msg) != -1) { + return true; + } + } + return false; + }, 'Could not find log entries containing the following message: ' + msg, timeout, 300); }; /* |