summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/backup_restore.js15
-rw-r--r--jstests/noPassthrough/commands_handle_kill.js8
-rw-r--r--jstests/noPassthrough/count_helper_read_preference.js5
-rw-r--r--jstests/noPassthrough/currentop_query.js6
-rw-r--r--jstests/noPassthrough/cursor_timeout.js7
-rw-r--r--jstests/noPassthrough/exit_logging.js51
-rw-r--r--jstests/noPassthrough/ftdc_setparam.js4
-rw-r--r--jstests/noPassthrough/geo_full.js139
-rw-r--r--jstests/noPassthrough/geo_mnypts_plus_fields.js8
-rw-r--r--jstests/noPassthrough/initial_sync_cloner_dups.js7
-rw-r--r--jstests/noPassthrough/javascript_options.js4
-rw-r--r--jstests/noPassthrough/js_protection.js17
-rw-r--r--jstests/noPassthrough/lock_stats.js8
-rw-r--r--jstests/noPassthrough/logging_options.js20
-rw-r--r--jstests/noPassthrough/minvalid2.js5
-rw-r--r--jstests/noPassthrough/parameters.js12
-rw-r--r--jstests/noPassthrough/profile_options.js12
-rw-r--r--jstests/noPassthrough/read_committed_lookup.js8
-rw-r--r--jstests/noPassthrough/read_majority.js4
-rw-r--r--jstests/noPassthrough/read_majority_reads.js24
-rw-r--r--jstests/noPassthrough/sync_write.js6
-rw-r--r--jstests/noPassthrough/update_server-5552.js19
-rw-r--r--jstests/noPassthrough/write_local.js4
-rw-r--r--jstests/noPassthrough/wt_index_option_defaults.js17
-rw-r--r--jstests/noPassthrough/wt_nojournal_repl.js7
25 files changed, 149 insertions, 268 deletions
diff --git a/jstests/noPassthrough/backup_restore.js b/jstests/noPassthrough/backup_restore.js
index 2a896dcb2c7..3e15e2b114b 100644
--- a/jstests/noPassthrough/backup_restore.js
+++ b/jstests/noPassthrough/backup_restore.js
@@ -229,12 +229,8 @@
rst.waitForState(rst.getSecondaries(), ReplSetTest.State.SECONDARY, 60 * 1000);
// Add new hidden node to replSetTest
- var hiddenCfg = {
- restart: true,
- oplogSize: 1024,
- dbpath: hiddenDbpath,
- replSet: replSetName
- };
+ var hiddenCfg =
+ {restart: true, oplogSize: 1024, dbpath: hiddenDbpath, replSet: replSetName};
rst.add(hiddenCfg);
var hiddenHost = rst.nodes[numNodes].host;
@@ -257,12 +253,7 @@
// Add new hidden secondary to replica set
var rsConfig = primary.getDB("local").system.replset.findOne();
rsConfig.version += 1;
- var hiddenMember = {
- _id: numNodes,
- host: hiddenHost,
- priority: 0,
- hidden: true
- };
+ var hiddenMember = {_id: numNodes, host: hiddenHost, priority: 0, hidden: true};
rsConfig.members.push(hiddenMember);
assert.commandWorked(primary.adminCommand({replSetReconfig: rsConfig}),
testName + ' failed to reconfigure replSet ' + tojson(rsConfig));
diff --git a/jstests/noPassthrough/commands_handle_kill.js b/jstests/noPassthrough/commands_handle_kill.js
index b7ad6ea1bea..d2aedb8f4ea 100644
--- a/jstests/noPassthrough/commands_handle_kill.js
+++ b/jstests/noPassthrough/commands_handle_kill.js
@@ -70,12 +70,8 @@
// group command errors if plan executor is killed.
res = db.runCommand({
- group: {
- ns: coll.getFullName(),
- key: "_id",
- $reduce: function(curr, result) {},
- initial: {}
- }
+ group:
+ {ns: coll.getFullName(), key: "_id", $reduce: function(curr, result) {}, initial: {}}
});
assert.commandFailed(res);
assert(res.errmsg.indexOf("hit planExecutorAlwaysDead fail point") > -1);
diff --git a/jstests/noPassthrough/count_helper_read_preference.js b/jstests/noPassthrough/count_helper_read_preference.js
index a049e586598..b07621f3498 100644
--- a/jstests/noPassthrough/count_helper_read_preference.js
+++ b/jstests/noPassthrough/count_helper_read_preference.js
@@ -10,10 +10,7 @@
MockMongo.prototype = Mongo.prototype;
MockMongo.prototype.runCommand = function(db, cmd, opts) {
commandsRan.push({db: db, cmd: cmd, opts: opts});
- return {
- ok: 1,
- n: 100
- };
+ return {ok: 1, n: 100};
};
var db = new DB(new MockMongo(), "test");
diff --git a/jstests/noPassthrough/currentop_query.js b/jstests/noPassthrough/currentop_query.js
index deb470666af..b72da385564 100644
--- a/jstests/noPassthrough/currentop_query.js
+++ b/jstests/noPassthrough/currentop_query.js
@@ -47,9 +47,7 @@
testObj.currentOpFilter.ns = coll.getFullName();
testObj.currentOpFilter.planSummary = testObj.planSummary;
if (testObj.hasOwnProperty("command")) {
- testObj.currentOpFilter["query." + testObj.command] = {
- $exists: true
- };
+ testObj.currentOpFilter["query." + testObj.command] = {$exists: true};
} else if (testObj.hasOwnProperty("operation")) {
testObj.currentOpFilter.op = testObj.operation;
}
@@ -132,7 +130,7 @@
reduce: function() {},
initial: {}
}),
- [{"a": 1}]);
+ [{"a": 1}]);
},
command: "group",
planSummary: "COLLSCAN",
diff --git a/jstests/noPassthrough/cursor_timeout.js b/jstests/noPassthrough/cursor_timeout.js
index f74521b9bc9..46a054da0ea 100644
--- a/jstests/noPassthrough/cursor_timeout.js
+++ b/jstests/noPassthrough/cursor_timeout.js
@@ -39,12 +39,7 @@ for (x = 0; x < 200; x++) {
var chunkDoc = configDB.chunks.findOne();
var chunkOwner = chunkDoc.shard;
var toShard = configDB.shards.findOne({_id: {$ne: chunkOwner}})._id;
-var cmd = {
- moveChunk: coll.getFullName(),
- find: chunkDoc.min,
- to: toShard,
- _waitForDelete: true
-};
+var cmd = {moveChunk: coll.getFullName(), find: chunkDoc.min, to: toShard, _waitForDelete: true};
var res = adminDB.runCommand(cmd);
jsTest.log('move result: ' + tojson(res));
diff --git a/jstests/noPassthrough/exit_logging.js b/jstests/noPassthrough/exit_logging.js
index 0647f312cc4..f996766866f 100644
--- a/jstests/noPassthrough/exit_logging.js
+++ b/jstests/noPassthrough/exit_logging.js
@@ -25,23 +25,23 @@
function checkOutput() {
var logContents = "";
- assert.soon(() =>
- {
- logContents = rawMongoProgramOutput();
- return matchFn(logContents);
- },
- function() {
- // We can't just return a string because it will be well over the max
- // line length.
- // So we just print manually.
- print("================ BEGIN LOG CONTENTS ==================");
- logContents.split(/\n/).forEach((line) => {
- print(line);
- });
- print("================ END LOG CONTENTS =====================");
- return "";
- },
- 30000);
+ assert.soon(
+ () => {
+ logContents = rawMongoProgramOutput();
+ return matchFn(logContents);
+ },
+ function() {
+ // We can't just return a string because it will be well over the max
+ // line length.
+ // So we just print manually.
+ print("================ BEGIN LOG CONTENTS ==================");
+ logContents.split(/\n/).forEach((line) => {
+ print(line);
+ });
+ print("================ END LOG CONTENTS =====================");
+ return "";
+ },
+ 30000);
}
try {
@@ -55,12 +55,9 @@
function runAllTests(launcher) {
const SIGSEGV = 11;
const SIGABRT = 6;
- testShutdownLogging(launcher,
- function(conn) {
- conn.getDB('admin').shutdownServer();
- },
- makeRegExMatchFn(/shutdown command received/),
- MongoRunner.EXIT_CLEAN);
+ testShutdownLogging(launcher, function(conn) {
+ conn.getDB('admin').shutdownServer();
+ }, makeRegExMatchFn(/shutdown command received/), MongoRunner.EXIT_CLEAN);
testShutdownLogging(launcher,
makeShutdownByCrashFn('fault'),
@@ -88,9 +85,7 @@
runAllTests({
start: function(opts) {
- var actualOpts = {
- nojournal: ""
- };
+ var actualOpts = {nojournal: ""};
Object.extend(actualOpts, opts);
return MongoRunner.runMongod(actualOpts);
},
@@ -105,9 +100,7 @@
var st = new ShardingTest({shards: 1, other: {shardOptions: {nojournal: ""}}});
var mongosLauncher = {
start: function(opts) {
- var actualOpts = {
- configdb: st._configDB
- };
+ var actualOpts = {configdb: st._configDB};
Object.extend(actualOpts, opts);
return MongoRunner.runMongos(actualOpts);
},
diff --git a/jstests/noPassthrough/ftdc_setparam.js b/jstests/noPassthrough/ftdc_setparam.js
index 73e3f8720a6..d4cf4029426 100644
--- a/jstests/noPassthrough/ftdc_setparam.js
+++ b/jstests/noPassthrough/ftdc_setparam.js
@@ -7,9 +7,7 @@
// Check the defaults are correct
//
function getparam(field) {
- var q = {
- getParameter: 1
- };
+ var q = {getParameter: 1};
q[field] = 1;
var ret = m.getDB("admin").runCommand(q);
diff --git a/jstests/noPassthrough/geo_full.js b/jstests/noPassthrough/geo_full.js
index 505a0efab33..491229233f5 100644
--- a/jstests/noPassthrough/geo_full.js
+++ b/jstests/noPassthrough/geo_full.js
@@ -46,13 +46,7 @@ var randEnvironment = function() {
var range = max - min;
var bucketSize = range / (4 * 1024 * 1024 * 1024);
- return {
- max: max,
- min: min,
- bits: bits,
- earth: false,
- bucketSize: bucketSize
- };
+ return {max: max, min: min, bits: bits, earth: false, bucketSize: bucketSize};
};
var randPoint = function(env, query) {
@@ -107,10 +101,7 @@ var randDataType = function() {
maxLocs = Math.floor(Random.rand() * locScale) + 1;
}
- return {
- numDocs: numDocs,
- maxLocs: maxLocs
- };
+ return {numDocs: numDocs, maxLocs: maxLocs};
};
function deg2rad(arg) {
@@ -241,22 +232,13 @@ var queryResults = function(locs, query, results) {
if (!results["center"]) {
for (var type in resultTypes) {
- results[type] = {
- docsIn: 0,
- docsOut: 0,
- locsIn: 0,
- locsOut: 0
- };
+ results[type] = {docsIn: 0, docsOut: 0, locsIn: 0, locsOut: 0};
}
}
var indResults = {};
for (var type in resultTypes) {
- indResults[type] = {
- docIn: false,
- locsIn: 0,
- locsOut: 0
- };
+ indResults[type] = {docIn: false, locsIn: 0, locsOut: 0};
}
for (var type in resultTypes) {
@@ -313,29 +295,19 @@ var randYesQuery = function() {
var choice = Math.floor(Random.rand() * 7);
if (choice == 0)
- return {
- $ne: "no"
- };
+ return {$ne: "no"};
else if (choice == 1)
return "yes";
else if (choice == 2)
return /^yes/;
else if (choice == 3)
- return {
- $in: ["good", "yes", "ok"]
- };
+ return {$in: ["good", "yes", "ok"]};
else if (choice == 4)
- return {
- $exists: true
- };
+ return {$exists: true};
else if (choice == 5)
- return {
- $nin: ["bad", "no", "not ok"]
- };
+ return {$nin: ["bad", "no", "not ok"]};
else if (choice == 6)
- return {
- $not: /^no/
- };
+ return {$not: /^no/};
};
var locArray = function(loc) {
@@ -423,13 +395,9 @@ for (var test = 0; test < numTests; test++) {
var doc;
// Nest the keys differently
if (Random.rand() < 0.5)
- doc = {
- locs: {loc: randLocTypes(multiPoint)}
- };
+ doc = {locs: {loc: randLocTypes(multiPoint)}};
else
- doc = {
- locs: randLocTypes(multiPoint, "loc")
- };
+ doc = {locs: randLocTypes(multiPoint, "loc")};
randQueryAdditions(doc, indResults);
@@ -438,9 +406,7 @@ for (var test = 0; test < numTests; test++) {
}
assert.writeOK(bulk.execute());
- var indexDoc = {
- "locs.loc": "2d"
- };
+ var indexDoc = {"locs.loc": "2d"};
randIndexAdditions(indexDoc);
t.ensureIndex(indexDoc, env);
assert.isnull(db.getLastError());
@@ -472,19 +438,18 @@ for (var test = 0; test < numTests; test++) {
print("Min box : " + minBoxSize(env, query.radius));
assert.eq(results.center.docsIn,
t.find({
- "locs.loc": {$within: {$center: [query.center, query.radius], $uniqueDocs: 1}},
- "center.docIn": randYesQuery()
- }).count());
+ "locs.loc": {$within: {$center: [query.center, query.radius], $uniqueDocs: 1}},
+ "center.docIn": randYesQuery()
+ }).count());
print("Center query update...");
- var res = t.update(
- {
- "locs.loc": {$within: {$center: [query.center, query.radius], $uniqueDocs: true}},
- "center.docIn": randYesQuery()
- },
- {$set: {centerPaddingA: padding}},
- false,
- true);
+ var res = t.update({
+ "locs.loc": {$within: {$center: [query.center, query.radius], $uniqueDocs: true}},
+ "center.docIn": randYesQuery()
+ },
+ {$set: {centerPaddingA: padding}},
+ false,
+ true);
assert.eq(results.center.docsIn, res.nModified);
if (query.sphereRadius >= 0) {
@@ -493,41 +458,37 @@ for (var test = 0; test < numTests; test++) {
assert.eq(
results.sphere.docsIn,
t.find({
- "locs.loc": {$within: {$centerSphere: [query.sphereCenter, query.sphereRadius]}},
- "sphere.docIn": randYesQuery()
- }).count());
+ "locs.loc": {$within: {$centerSphere: [query.sphereCenter, query.sphereRadius]}},
+ "sphere.docIn": randYesQuery()
+ }).count());
print("Center sphere query update...");
- res = t.update(
- {
- "locs.loc": {
- $within: {
- $centerSphere: [query.sphereCenter, query.sphereRadius],
- $uniqueDocs: true
- }
- },
- "sphere.docIn": randYesQuery()
+ res = t.update({
+ "locs.loc": {
+ $within:
+ {$centerSphere: [query.sphereCenter, query.sphereRadius], $uniqueDocs: true}
},
- {$set: {spherePaddingA: padding}},
- false,
- true);
+ "sphere.docIn": randYesQuery()
+ },
+ {$set: {spherePaddingA: padding}},
+ false,
+ true);
assert.eq(results.sphere.docsIn, res.nModified);
}
// $box
print("Box query...");
- assert.eq(results.box.docsIn,
- t.find({
- "locs.loc": {$within: {$box: query.box, $uniqueDocs: true}},
- "box.docIn": randYesQuery()
- }).count());
+ assert.eq(results.box.docsIn, t.find({
+ "locs.loc": {$within: {$box: query.box, $uniqueDocs: true}},
+ "box.docIn": randYesQuery()
+ }).count());
// $polygon
print("Polygon query...");
- assert.eq(
- results.poly.docsIn,
- t.find({"locs.loc": {$within: {$polygon: query.boxPoly}}, "poly.docIn": randYesQuery()})
- .count());
+ assert.eq(results.poly.docsIn, t.find({
+ "locs.loc": {$within: {$polygon: query.boxPoly}},
+ "poly.docIn": randYesQuery()
+ }).count());
var defaultDocLimit = 100;
@@ -544,8 +505,8 @@ for (var test = 0; test < numTests; test++) {
assert.eq(
results.sphere.docsIn,
t.find({
- "locs.loc": {$nearSphere: query.sphereCenter, $maxDistance: query.sphereRadius}
- }).count(true),
+ "locs.loc": {$nearSphere: query.sphereCenter, $maxDistance: query.sphereRadius}
+ }).count(true),
"Near sphere query: sphere center: " + query.sphereCenter + "; radius: " +
query.sphereRadius + "; docs: " + results.sphere.docsIn + "; locs: " +
results.sphere.locsIn);
@@ -568,12 +529,12 @@ for (var test = 0; test < numTests; test++) {
var num = Math.min(2 * defaultDocLimit, 2 * results.center.docsIn);
var output = db.runCommand({
- geoNear: "testAllGeo",
- near: query.center,
- maxDistance: query.radius,
- includeLocs: true,
- num: num
- }).results;
+ geoNear: "testAllGeo",
+ near: query.center,
+ maxDistance: query.radius,
+ includeLocs: true,
+ num: num
+ }).results;
assert.eq(Math.min(num, results.center.docsIn),
output.length,
diff --git a/jstests/noPassthrough/geo_mnypts_plus_fields.js b/jstests/noPassthrough/geo_mnypts_plus_fields.js
index 801c7dcfc8b..eb8a03ce739 100644
--- a/jstests/noPassthrough/geo_mnypts_plus_fields.js
+++ b/jstests/noPassthrough/geo_mnypts_plus_fields.js
@@ -17,9 +17,7 @@ for (var fields = 1; fields < maxFields; fields++) {
for (var i = 0; i < totalPts; i++) {
var ii = i % 10000;
- var doc = {
- loc: [ii % 100, Math.floor(ii / 100)]
- };
+ var doc = {loc: [ii % 100, Math.floor(ii / 100)]};
// Add fields with different kinds of data
for (var j = 0; j < fields; j++) {
@@ -49,9 +47,7 @@ for (var fields = 1; fields < maxFields; fields++) {
if (j % 3 == 0) {
field = "abcdefg";
} else if (j % 3 == 1) {
- field = {
- $lte: new Date()
- };
+ field = {$lte: new Date()};
} else {
field = true;
}
diff --git a/jstests/noPassthrough/initial_sync_cloner_dups.js b/jstests/noPassthrough/initial_sync_cloner_dups.js
index dd0e05a8673..8967e94722c 100644
--- a/jstests/noPassthrough/initial_sync_cloner_dups.js
+++ b/jstests/noPassthrough/initial_sync_cloner_dups.js
@@ -100,10 +100,9 @@
// Removed the assertion because it was too flaky. Printing a warning instead (dan)
jsTestLog("making sure we dropped some dups");
var res = secondary.adminCommand({getLog: "global"});
- var droppedDups = (contains(res.log,
- function(v) {
- return v.indexOf("index build dropped" /* NNN dups*/) != -1;
- }));
+ var droppedDups = (contains(res.log, function(v) {
+ return v.indexOf("index build dropped" /* NNN dups*/) != -1;
+ }));
if (!droppedDups) {
jsTestLog(
"Warning: Test did not trigger duplicate documents, this run will be a false negative");
diff --git a/jstests/noPassthrough/javascript_options.js b/jstests/noPassthrough/javascript_options.js
index e0f1690bd5d..52cc641b274 100644
--- a/jstests/noPassthrough/javascript_options.js
+++ b/jstests/noPassthrough/javascript_options.js
@@ -3,9 +3,7 @@ var baseName = "jstests_nopassthrough_javascript_options";
load('jstests/libs/command_line/test_parsed_options.js');
jsTest.log("Testing \"noscripting\" command line option");
-var expectedResult = {
- "parsed": {"security": {"javascriptEnabled": false}}
-};
+var expectedResult = {"parsed": {"security": {"javascriptEnabled": false}}};
testGetCmdLineOptsMongod({noscripting: ""}, expectedResult);
jsTest.log("Testing explicitly disabled \"noscripting\" config file option");
diff --git a/jstests/noPassthrough/js_protection.js b/jstests/noPassthrough/js_protection.js
index 1299131289d..eda42395cd9 100644
--- a/jstests/noPassthrough/js_protection.js
+++ b/jstests/noPassthrough/js_protection.js
@@ -55,15 +55,14 @@
assert.neq(null, doc);
assert.eq(0, doc.y, tojson(doc));
- res = t.update(
- {
- $where: function() {
- return this.val === 0;
- }
- },
- {$set: {y: 100}},
- false,
- true);
+ res = t.update({
+ $where: function() {
+ return this.val === 0;
+ }
+ },
+ {$set: {y: 100}},
+ false,
+ true);
assert.writeOK(res);
doc = t.findOne({name: "testdoc"});
diff --git a/jstests/noPassthrough/lock_stats.js b/jstests/noPassthrough/lock_stats.js
index 078a22ead2d..73a3027b33f 100644
--- a/jstests/noPassthrough/lock_stats.js
+++ b/jstests/noPassthrough/lock_stats.js
@@ -36,14 +36,10 @@
// The server was just started, so initial stats may be missing.
if (!startStats.acquireWaitCount || !startStats.acquireWaitCount.W) {
- startStats.acquireWaitCount = {
- W: 0
- };
+ startStats.acquireWaitCount = {W: 0};
}
if (!startStats.timeAcquiringMicros || !startStats.timeAcquiringMicros.W) {
- startStats.timeAcquiringMicros = {
- W: 0
- };
+ startStats.timeAcquiringMicros = {W: 0};
}
var acquireWaitCount = endStats.acquireWaitCount.W - startStats.acquireWaitCount.W;
diff --git a/jstests/noPassthrough/logging_options.js b/jstests/noPassthrough/logging_options.js
index 794680fa937..238faa3c618 100644
--- a/jstests/noPassthrough/logging_options.js
+++ b/jstests/noPassthrough/logging_options.js
@@ -4,34 +4,24 @@ load('jstests/libs/command_line/test_parsed_options.js');
// Verbosity testing
jsTest.log("Testing \"verbose\" command line option with no args");
-var expectedResult = {
- "parsed": {"systemLog": {"verbosity": 1}}
-};
+var expectedResult = {"parsed": {"systemLog": {"verbosity": 1}}};
testGetCmdLineOptsMongod({verbose: ""}, expectedResult);
jsTest.log("Testing \"verbose\" command line option with one \"v\"");
-var expectedResult = {
- "parsed": {"systemLog": {"verbosity": 1}}
-};
+var expectedResult = {"parsed": {"systemLog": {"verbosity": 1}}};
testGetCmdLineOptsMongod({verbose: "v"}, expectedResult);
jsTest.log("Testing \"verbose\" command line option with two \"v\"s");
-var expectedResult = {
- "parsed": {"systemLog": {"verbosity": 2}}
-};
+var expectedResult = {"parsed": {"systemLog": {"verbosity": 2}}};
testGetCmdLineOptsMongod({verbose: "vv"}, expectedResult);
jsTest.log("Testing \"v\" command line option");
-var expectedResult = {
- "parsed": {"systemLog": {"verbosity": 1}}
-};
+var expectedResult = {"parsed": {"systemLog": {"verbosity": 1}}};
// Currently the test converts "{ v : 1 }" to "-v" when it spawns the binary.
testGetCmdLineOptsMongod({v: 1}, expectedResult);
jsTest.log("Testing \"vv\" command line option");
-var expectedResult = {
- "parsed": {"systemLog": {"verbosity": 2}}
-};
+var expectedResult = {"parsed": {"systemLog": {"verbosity": 2}}};
// Currently the test converts "{ v : 2 }" to "-vv" when it spawns the binary.
testGetCmdLineOptsMongod({v: 2}, expectedResult);
diff --git a/jstests/noPassthrough/minvalid2.js b/jstests/noPassthrough/minvalid2.js
index a9096805b66..2eb167444ad 100644
--- a/jstests/noPassthrough/minvalid2.js
+++ b/jstests/noPassthrough/minvalid2.js
@@ -55,9 +55,8 @@ printjson(lastOp);
// Overwrite minvalid document to simulate an inconsistent state (as might result from a server
// crash.
-local.replset.minvalid.update({},
- {ts: new Timestamp(lastOp.ts.t, lastOp.ts.i + 1)},
- {upsert: true});
+local.replset.minvalid.update(
+ {}, {ts: new Timestamp(lastOp.ts.t, lastOp.ts.i + 1)}, {upsert: true});
printjson(local.replset.minvalid.findOne());
print("5: shut down master");
diff --git a/jstests/noPassthrough/parameters.js b/jstests/noPassthrough/parameters.js
index a4fe35446b4..ddc5def5864 100644
--- a/jstests/noPassthrough/parameters.js
+++ b/jstests/noPassthrough/parameters.js
@@ -2,17 +2,13 @@ var dbConn = MongoRunner.runMongod();
function setAndCheckParameter(dbConn, parameterName, newValue, expectedResult) {
jsTest.log("Test setting parameter: " + parameterName + " to value: " + newValue);
- var getParameterCommand = {
- getParameter: 1
- };
+ var getParameterCommand = {getParameter: 1};
getParameterCommand[parameterName] = 1;
var ret = dbConn.adminCommand(getParameterCommand);
assert.eq(ret.ok, 1, tojson(ret));
oldValue = ret[parameterName];
- var setParameterCommand = {
- setParameter: 1
- };
+ var setParameterCommand = {setParameter: 1};
setParameterCommand[parameterName] = newValue;
var ret = dbConn.adminCommand(setParameterCommand);
assert.eq(ret.ok, 1, tojson(ret));
@@ -45,9 +41,7 @@ setAndCheckParameter(dbConn, "replMonitorMaxFailedChecks", -30);
function ensureSetParameterFailure(dbConn, parameterName, newValue) {
jsTest.log("Test setting parameter: " + parameterName + " to invalid value: " + newValue);
- var setParameterCommand = {
- setParameter: 1
- };
+ var setParameterCommand = {setParameter: 1};
setParameterCommand[parameterName] = newValue;
var ret = dbConn.adminCommand(setParameterCommand);
assert.eq(ret.ok, 0, tojson(ret));
diff --git a/jstests/noPassthrough/profile_options.js b/jstests/noPassthrough/profile_options.js
index 0e45391a7ef..e3f9c8bcc03 100644
--- a/jstests/noPassthrough/profile_options.js
+++ b/jstests/noPassthrough/profile_options.js
@@ -3,21 +3,15 @@ var baseName = "jstests_core_profile_options";
load('jstests/libs/command_line/test_parsed_options.js');
jsTest.log("Testing \"profile\" command line option with profiling off");
-var expectedResult = {
- "parsed": {"operationProfiling": {"mode": "off"}}
-};
+var expectedResult = {"parsed": {"operationProfiling": {"mode": "off"}}};
testGetCmdLineOptsMongod({profile: "0"}, expectedResult);
jsTest.log("Testing \"profile\" command line option with profiling slow operations on");
-var expectedResult = {
- "parsed": {"operationProfiling": {"mode": "slowOp"}}
-};
+var expectedResult = {"parsed": {"operationProfiling": {"mode": "slowOp"}}};
testGetCmdLineOptsMongod({profile: "1"}, expectedResult);
jsTest.log("Testing \"profile\" command line option with profiling all on");
-var expectedResult = {
- "parsed": {"operationProfiling": {"mode": "all"}}
-};
+var expectedResult = {"parsed": {"operationProfiling": {"mode": "all"}}};
testGetCmdLineOptsMongod({profile: "2"}, expectedResult);
jsTest.log("Testing \"operationProfiling.mode\" config file option");
diff --git a/jstests/noPassthrough/read_committed_lookup.js b/jstests/noPassthrough/read_committed_lookup.js
index e66195739ee..a8b3ff8522d 100644
--- a/jstests/noPassthrough/read_committed_lookup.js
+++ b/jstests/noPassthrough/read_committed_lookup.js
@@ -63,9 +63,7 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority.
}
// Seed matching data.
- var majorityWriteConcernObj = {
- writeConcern: {w: "majority", wtimeout: 60 * 1000}
- };
+ var majorityWriteConcernObj = {writeConcern: {w: "majority", wtimeout: 60 * 1000}};
var localId = db.local.insertOne({foreignKey: "x"}, majorityWriteConcernObj).insertedId;
var foreignId = db.foreign.insertOne({matchedField: "x"}, majorityWriteConcernObj).insertedId;
@@ -90,7 +88,9 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority.
var expectedMatchedResult = [{
_id: localId,
foreignKey: "x",
- match: [{_id: foreignId, matchedField: "x"}, ],
+ match: [
+ {_id: foreignId, matchedField: "x"},
+ ],
}];
var expectedUnmatchedResult = [{
_id: localId,
diff --git a/jstests/noPassthrough/read_majority.js b/jstests/noPassthrough/read_majority.js
index 3d84fce0911..c2b20df292a 100644
--- a/jstests/noPassthrough/read_majority.js
+++ b/jstests/noPassthrough/read_majority.js
@@ -28,8 +28,8 @@ load("jstests/libs/analyze_plan.js");
var t = db.readMajority;
function assertNoReadMajoritySnapshotAvailable() {
- var res = t.runCommand('find',
- {batchSize: 2, readConcern: {level: "majority"}, maxTimeMS: 1000});
+ var res =
+ t.runCommand('find', {batchSize: 2, readConcern: {level: "majority"}, maxTimeMS: 1000});
assert.commandFailed(res);
assert.eq(res.code, ErrorCodes.ExceededTimeLimit);
}
diff --git a/jstests/noPassthrough/read_majority_reads.js b/jstests/noPassthrough/read_majority_reads.js
index 5c169e3bed7..92a0032a2cd 100644
--- a/jstests/noPassthrough/read_majority_reads.js
+++ b/jstests/noPassthrough/read_majority_reads.js
@@ -86,12 +86,11 @@
},
geoNear: {
run: function(coll) {
- var res = coll.runCommand('geoNear',
- {
- readConcern: {level: 'majority'},
- near: [0, 0],
- spherical: true,
- });
+ var res = coll.runCommand('geoNear', {
+ readConcern: {level: 'majority'},
+ near: [0, 0],
+ spherical: true,
+ });
assert.commandWorked(res);
assert.eq(res.results.length, 1, tojson(res));
return res.results[0].obj.state;
@@ -101,13 +100,12 @@
},
geoSearch: {
run: function(coll) {
- var res = coll.runCommand('geoSearch',
- {
- readConcern: {level: 'majority'},
- near: [0, 0],
- search: {_id: 1}, // Needed due to SERVER-23158.
- maxDistance: 1,
- });
+ var res = coll.runCommand('geoSearch', {
+ readConcern: {level: 'majority'},
+ near: [0, 0],
+ search: {_id: 1}, // Needed due to SERVER-23158.
+ maxDistance: 1,
+ });
assert.commandWorked(res);
assert.eq(res.results.length, 1, tojson(res));
return res.results[0].state;
diff --git a/jstests/noPassthrough/sync_write.js b/jstests/noPassthrough/sync_write.js
index 04c654cff72..b2f2fa24a45 100644
--- a/jstests/noPassthrough/sync_write.js
+++ b/jstests/noPassthrough/sync_write.js
@@ -11,11 +11,7 @@
var dbpath = MongoRunner.dataPath + 'sync_write';
resetDbpath(dbpath);
- var mongodArgs = {
- dbpath: dbpath,
- noCleanData: true,
- journal: ''
- };
+ var mongodArgs = {dbpath: dbpath, noCleanData: true, journal: ''};
// Start a mongod.
var conn = MongoRunner.runMongod(mongodArgs);
diff --git a/jstests/noPassthrough/update_server-5552.js b/jstests/noPassthrough/update_server-5552.js
index 146dd0dab31..453914d6b3d 100644
--- a/jstests/noPassthrough/update_server-5552.js
+++ b/jstests/noPassthrough/update_server-5552.js
@@ -16,16 +16,15 @@ assert.writeOK(bulk.execute());
join = startParallelShell(
"while( db.foo.findOne( { _id : 0 } ).x == 1 ); db.foo.ensureIndex( { x : 1 } );");
-t.update(
- {
- $where: function() {
- sleep(1);
- return true;
- }
- },
- {$set: {x: 5}},
- false,
- true);
+t.update({
+ $where: function() {
+ sleep(1);
+ return true;
+ }
+},
+ {$set: {x: 5}},
+ false,
+ true);
db.getLastError();
join();
diff --git a/jstests/noPassthrough/write_local.js b/jstests/noPassthrough/write_local.js
index 019b8c437f7..0cfda86003f 100644
--- a/jstests/noPassthrough/write_local.js
+++ b/jstests/noPassthrough/write_local.js
@@ -3,9 +3,7 @@
'use strict';
// Limit concurrent WiredTiger transactions to maximize locking issues, harmless for other SEs.
- var options = {
- verbose: 1
- };
+ var options = {verbose: 1};
// Create a new single node replicaSet
var replTest =
diff --git a/jstests/noPassthrough/wt_index_option_defaults.js b/jstests/noPassthrough/wt_index_option_defaults.js
index 2516cc28d24..8609666a14d 100644
--- a/jstests/noPassthrough/wt_index_option_defaults.js
+++ b/jstests/noPassthrough/wt_index_option_defaults.js
@@ -56,14 +56,13 @@
// Start a mongod with system-wide defaults for engine-specific index options.
var conn = MongoRunner.runMongod({
dbpath: dbpath,
- noCleanData: true, [engine + 'IndexConfigString']: systemWideConfigString,
+ noCleanData: true,
+ [engine + 'IndexConfigString']: systemWideConfigString,
});
assert.neq(null, conn, 'mongod was unable to start up');
var testDB = conn.getDB('test');
- var cmdObj = {
- create: 'coll'
- };
+ var cmdObj = {create: 'coll'};
// Apply collection-wide defaults for engine-specific index options if any were
// specified.
@@ -78,12 +77,10 @@
assert.commandWorked(testDB.coll.createIndex({a: 1}, {name: 'without_options'}));
// Create an index that specifies engine-specific index options.
- assert.commandWorked(testDB.coll.createIndex(
- {b: 1},
- {
- name: 'with_options',
- storageEngine: {[engine]: {configString: indexSpecificConfigString}}
- }));
+ assert.commandWorked(testDB.coll.createIndex({b: 1}, {
+ name: 'with_options',
+ storageEngine: {[engine]: {configString: indexSpecificConfigString}}
+ }));
var collStats = testDB.runCommand({collStats: 'coll'});
assert.commandWorked(collStats);
diff --git a/jstests/noPassthrough/wt_nojournal_repl.js b/jstests/noPassthrough/wt_nojournal_repl.js
index b9c58a516db..8e25d5923f8 100644
--- a/jstests/noPassthrough/wt_nojournal_repl.js
+++ b/jstests/noPassthrough/wt_nojournal_repl.js
@@ -73,10 +73,9 @@ if (jsTest.options().storageEngine && jsTest.options().storageEngine !== "wiredT
// Test that the restarted secondary did NOT do an initial sync by checking the log
var res = secondary1.adminCommand({getLog: "global"});
- assert(!contains(res.log,
- function(v) {
- return v.indexOf("initial sync") != -1;
- }));
+ assert(!contains(res.log, function(v) {
+ return v.indexOf("initial sync") != -1;
+ }));
jsTestLog("check data is in both collections");
assert.eq(secondary1.getDB("test").foo.count(), 100);