0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/pummel/test-abort-fatal-error.js
cjihrig ff1efa6087 test: use const for all require() calls
PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-02 18:28:18 -05:00

31 lines
725 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
if (common.isWindows) {
common.skip('no RLIMIT_NOFILE on Windows');
return;
}
const exec = require('child_process').exec;
var cmdline = 'ulimit -c 0; ' + process.execPath;
cmdline += ' --max-old-space-size=4 --max-semi-space-size=1';
cmdline += ' -e "a = []; for (i = 0; i < 1e9; i++) { a.push({}) }"';
exec(cmdline, function(err, stdout, stderr) {
if (!err) {
console.log(stdout);
console.log(stderr);
assert(false, 'this test should fail');
return;
}
if (err.code !== 134 && err.signal !== 'SIGABRT') {
console.log(stdout);
console.log(stderr);
console.log(err);
assert(false, err);
}
});