mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
test: make abort-fatal-error more robust
It's saner to check exit codes or signals to determine if the process actually aborted. On OSX and Linux the exit code is 134, on SunOS it propagates the SIGABRT signal
This commit is contained in:
@@ -34,6 +34,17 @@ cmdline += ' --max-old-space-size=4 --max-new-space-size=1';
|
||||
cmdline += ' -e "a = []; for (i = 0; i < 1e9; i++) { a.push({}) }"';
|
||||
|
||||
exec(cmdline, function(err, stdout, stderr) {
|
||||
assert(err);
|
||||
assert(stderr.toString().match(/abort/i));
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user