summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/loglong.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
commitc1a45ebbb0530e3d0201321d725527f1eb83ffce (patch)
treef523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/noPassthrough/loglong.js
parentc9599d8610c3da0b7c3da65667aff821063cf5b9 (diff)
downloadmongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/noPassthrough/loglong.js')
-rw-r--r--jstests/noPassthrough/loglong.js70
1 files changed, 36 insertions, 34 deletions
diff --git a/jstests/noPassthrough/loglong.js b/jstests/noPassthrough/loglong.js
index 9e3aa577f3b..db60b5f1745 100644
--- a/jstests/noPassthrough/loglong.js
+++ b/jstests/noPassthrough/loglong.js
@@ -2,53 +2,55 @@
// make sure very long long lines get truncated
(function() {
- "use strict";
+"use strict";
- const options = {setParameter: "maxLogSizeKB=9"};
- const conn = MongoRunner.runMongod(options);
+const options = {
+ setParameter: "maxLogSizeKB=9"
+};
+const conn = MongoRunner.runMongod(options);
- var db = conn.getDB('db');
- var res = db.adminCommand({getParameter: 1, maxLogSizeKB: 1});
- assert.eq(9, res.maxLogSizeKB);
+var db = conn.getDB('db');
+var res = db.adminCommand({getParameter: 1, maxLogSizeKB: 1});
+assert.eq(9, res.maxLogSizeKB);
- var t = db.loglong;
- t.drop();
+var t = db.loglong;
+t.drop();
- t.insert({x: 1});
+t.insert({x: 1});
- var n = 0;
- var query = {x: []};
- while (Object.bsonsize(query) < 30000) {
- query.x.push(n++);
- }
+var n = 0;
+var query = {x: []};
+while (Object.bsonsize(query) < 30000) {
+ query.x.push(n++);
+}
- assertLogTruncated(db, t, 9);
+assertLogTruncated(db, t, 9);
- var res = db.adminCommand({setParameter: 1, maxLogSizeKB: 8});
- assert.eq(res.ok, 1);
+var res = db.adminCommand({setParameter: 1, maxLogSizeKB: 8});
+assert.eq(res.ok, 1);
- assertLogTruncated(db, t, 8);
+assertLogTruncated(db, t, 8);
- function assertLogTruncated(db, t, maxLogSize) {
- var before = db.adminCommand({setParameter: 1, logLevel: 1});
+function assertLogTruncated(db, t, maxLogSize) {
+ var before = db.adminCommand({setParameter: 1, logLevel: 1});
- t.findOne(query);
+ t.findOne(query);
- var x = db.adminCommand({setParameter: 1, logLevel: before.was});
- assert.eq(1, x.was, tojson(x));
+ var x = db.adminCommand({setParameter: 1, logLevel: before.was});
+ assert.eq(1, x.was, tojson(x));
- var log = db.adminCommand({getLog: "global"}).log;
+ 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) {
- found = true;
- break;
- }
+ 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) {
+ found = true;
+ break;
}
-
- assert(found, tojson(log));
}
- MongoRunner.stopMongod(conn);
+
+ assert(found, tojson(log));
+}
+MongoRunner.stopMongod(conn);
})(); \ No newline at end of file