summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
authorEddie Louie <eddie.louie@mongodb.com>2017-09-30 02:44:13 -0400
committerEddie Louie <eddie.louie@mongodb.com>2017-10-03 19:07:24 -0400
commit6ed8e31519f14f163606f17199f4cb9b0dccf281 (patch)
tree6d58788cfc5808ce60cfbffbc98d6dca85b50115 /jstests/noPassthrough
parent3a2666842f2a6ae57fdb09ccaedc629ca5871e67 (diff)
downloadmongo-6ed8e31519f14f163606f17199f4cb9b0dccf281.tar.gz
SERVER-29243 Move jsHeapLimit.js from core to noPassthrough
Plus add overrides for runMongod, ShardingTest and ReplSetTest to throw error if any js test in core.yml tries to use these to start their own mongod.
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/jsHeapLimit.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/jstests/noPassthrough/jsHeapLimit.js b/jstests/noPassthrough/jsHeapLimit.js
new file mode 100644
index 00000000000..512a79332ad
--- /dev/null
+++ b/jstests/noPassthrough/jsHeapLimit.js
@@ -0,0 +1,26 @@
+(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);
+})();