Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 2f5e77f

Browse files
committed
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
1 parent cd2d3ae commit 2f5e77f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/simple/test-abort-fatal-error.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ cmdline += ' --max-old-space-size=4 --max-new-space-size=1';
3434
cmdline += ' -e "a = []; for (i = 0; i < 1e9; i++) { a.push({}) }"';
3535

3636
exec(cmdline, function(err, stdout, stderr) {
37-
assert(err);
38-
assert(stderr.toString().match(/abort/i));
37+
if (!err) {
38+
console.log(stdout);
39+
console.log(stderr);
40+
assert(false, 'this test should fail');
41+
return;
42+
}
43+
44+
if (err.code !== 134 || err.signal !== 'SIGABRT') {
45+
console.log(stdout);
46+
console.log(stderr);
47+
console.log(err);
48+
assert(false, err);
49+
}
3950
});

0 commit comments

Comments
 (0)