diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-02-28 14:00:06 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-02 15:41:47 +0000 |
commit | ca547df9510ec9a6dc28e6eabf1e8542870f2bd1 (patch) | |
tree | 4d8623d78224c6880788fef652be4ce1de35b611 /jstests/noPassthrough | |
parent | e264fb226be9ae2bb429824f03c05b960aa1828e (diff) | |
download | mongo-ca547df9510ec9a6dc28e6eabf1e8542870f2bd1.tar.gz |
SERVER-46026 Fix loglong.js to check for JSON log truncation
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r-- | jstests/noPassthrough/loglong.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/noPassthrough/loglong.js b/jstests/noPassthrough/loglong.js index 0c33b3ccbe2..ff346e7f730 100644 --- a/jstests/noPassthrough/loglong.js +++ b/jstests/noPassthrough/loglong.js @@ -28,14 +28,14 @@ while (Object.bsonsize(query) < 30000) { query.x.push(n++); } -assertLogTruncated(db, t, 9); +assertLogTruncated(db, t); var res = db.adminCommand({setParameter: 1, maxLogSizeKB: 8}); assert.eq(res.ok, 1); -assertLogTruncated(db, t, 8); +assertLogTruncated(db, t); -function assertLogTruncated(db, t, maxLogSize) { +function assertLogTruncated(db, t) { var before = db.adminCommand({setParameter: 1, logLevel: 1}); t.findOne(query); @@ -46,9 +46,9 @@ function assertLogTruncated(db, t, maxLogSize) { var log = db.adminCommand({getLog: "global"}).log; var found = false; - var toFind = "warning: log line attempted (16kB) over max size (" + maxLogSize + "kB)"; for (var i = log.length - 1; i >= 0; i--) { - if (log[i].indexOf(toFind) >= 0) { + var obj = JSON.parse(log[i]); + if (obj.hasOwnProperty("truncated")) { found = true; break; } |