Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SERVER-21863, SERVER-22767: fix lint errors from recent backports.
  • Loading branch information
ramonfm committed Mar 29, 2016
1 parent d62c645 commit bc59fbb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
27 changes: 19 additions & 8 deletions jstests/core/mr_bigobject_replace.js
Expand Up @@ -14,7 +14,10 @@
// Returns a document of the form { _id: ObjectId(...), value: '...' } with the specified
// 'targetSize' in bytes.
function makeDocWithSize(targetSize) {
var doc = {_id: new ObjectId(), value: ''};
var doc = {
_id: new ObjectId(),
value: ''
};

var size = Object.bsonsize(doc);
assert.gte(targetSize, size);
Expand All @@ -38,17 +41,25 @@
// Insert a document so the mapper gets run.
assert.writeOK(db.input.insert({}));

var res = db.runCommand(Object.extend({
mapReduce: "input",
map: mapper,
out: {replace: "mr_bigobject_replace"},
}, testOptions));
var res = db.runCommand(Object.extend(
{
mapReduce: "input",
map: mapper,
out: {replace: "mr_bigobject_replace"},
},
testOptions));

assert.commandFailed(res, "creating a document larger than 16MB didn't fail");
assert.lte(0, res.errmsg.indexOf("object to insert too large"),
assert.lte(0,
res.errmsg.indexOf("object to insert too large"),
"map-reduce command failed for a reason other than inserting a large document");
}

runTest({reduce: createBigDocument});
runTest({reduce: function() { return 1; }, finalize: createBigDocument});
runTest({
reduce: function() {
return 1;
},
finalize: createBigDocument
});
})();
7 changes: 4 additions & 3 deletions jstests/noPassthrough/server22767.js
@@ -1,14 +1,15 @@
// test that the mongos doesn't segfault when it receives malformed BSON
var st = new ShardingTest({shards:1});
var st = new ShardingTest({shards: 1});
var testDB = st.getDB('test');
testDB.test.insert({a:1});
testDB.test.insert({a: 1});

try {
testDB.test.find({key: {$regex: 'abcd\0xyz'}}).explain();
} catch (e) {
/*
* if the mongos segfaults, the error is the msg:
* "Error: error doing query: failed: network error while attempting to run command 'explain' on host '127.0.0.1:20014'"
* "Error: error doing query: failed: network error while attempting to run command 'explain' on
*host '127.0.0.1:20014'"
*
* if the mongos doesn't segfault, the error is the object:
* "Error: explain failed: {
Expand Down

0 comments on commit bc59fbb

Please sign in to comment.