summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/jsHeapLimit.js
blob: 0089955c4a593e223cacc88af6bb3acb2473a712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(function() {
"use strict";

const options = {
    setParameter: "jsHeapLimitMB=1000"
};
const conn = MongoRunner.runMongod(options);

// verify JSHeapLimitMB set from the shell
var assertLimit = function() {
    assert.eq(999, getJSHeapLimitMB());
};
var exitCode = runMongoProgram(
    "mongo", conn.host, "--jsHeapLimitMB", 999, "--eval", "(" + assertLimit.toString() + ")();");
assert.eq(0, exitCode);

// verify the JSHeapLimitMB set from Mongod
const db = conn.getDB('test');
const res = db.adminCommand({getParameter: 1, jsHeapLimitMB: 1});
assert.commandWorked(res);
assert.eq(1000, res.jsHeapLimitMB);

MongoRunner.stopMongod(conn);
})();