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

test: make test-abort-fatal-error non flaky #25755

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/simple/simple.status
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ test-tls-securepair-server : PASS,FLAKY
test-timers-first-fire : PASS,FLAKY

[$system==linux]
test-abort-fatal-error : PASS,FLAKY
test-debugger-client : PASS,FLAKY
test-process-argv-0 : PASS,FLAKY
test-cluster-master-kill : PASS,FLAKY
Expand All @@ -29,7 +28,6 @@ test-cluster-master-error : PASS,FLAKY
test-http-exit-delay : PASS,FLAKY

[$system==solaris]
test-abort-fatal-error : PASS,FLAKY
test-debugger-repl : PASS,FLAKY
test-debugger-repl-break-in-module : PASS,FLAKY
test-debugger-repl-utf8 : PASS,FLAKY
Expand Down
19 changes: 15 additions & 4 deletions test/simple/test-abort-fatal-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,21 @@ if (process.platform === 'win32') {
var exec = require('child_process').exec;

var cmdline = 'ulimit -c 0; ' + process.execPath;
cmdline += ' --max-old-space-size=1 --max-new-space-size=1';
cmdline += ' -e "setInterval(function() { new Buffer(1024); }, 1);"';
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);
}
});