blob: 9eb644271d44dcb1cfcf802440a13cb5588a0498 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// SERVER-26596 This tests that you can set a very low heap limit for javascript, and that it will
// fail to run any javascript, but won't crash the server.
(function() {
'use strict';
assert.commandWorked(db.adminCommand({setParameter: 1, jsHeapLimitMB: 1}));
assert.commandFailedWithCode(db.runCommand({$eval: 'sleep(10000);'}),
ErrorCodes.ExceededMemoryLimit);
var returnCode = runProgram("mongo", "--jsHeapLimitMB=1", "--nodb", "--eval='exit();'");
assert.eq(returnCode, 1);
}());
|