diff options
| author | Jonathan Reams <jbreams@mongodb.com> | 2016-10-12 12:15:00 -0400 |
|---|---|---|
| committer | Jonathan Reams <jbreams@mongodb.com> | 2016-10-13 10:35:47 -0400 |
| commit | 0344a7542f9318730cce289fe143295f6f99b4f8 (patch) | |
| tree | 8dffa477f0ce2289391c7fc258cb4302d2f14fe8 /jstests/noPassthroughWithMongod | |
| parent | c3b7879a289740cd7acbdd066329a67664694b03 (diff) | |
| download | mongo-0344a7542f9318730cce289fe143295f6f99b4f8.tar.gz | |
SERVER-26596 Don't abort when javascript heap limit is set too low to initialize spidermonkey
Diffstat (limited to 'jstests/noPassthroughWithMongod')
| -rw-r--r-- | jstests/noPassthroughWithMongod/low_js_heap_limit.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/low_js_heap_limit.js b/jstests/noPassthroughWithMongod/low_js_heap_limit.js new file mode 100644 index 00000000000..9eb644271d4 --- /dev/null +++ b/jstests/noPassthroughWithMongod/low_js_heap_limit.js @@ -0,0 +1,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); +}()); |
