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

Commit

Permalink
test: make test-abort-fatal-error non flaky
Browse files Browse the repository at this point in the history
Before this change, test/simple/test-abort-fatal-error.js would fail in
some environments for reasons I wasn't able to fully understand. It was
marked as flaky on some systems, but not on others on which it was
failing sometimes (OSX).

This change back ports from v0.12 the parts of 429b5870q that apply to
this test. That commit made this test adapt to changes in V8 in the
v0.12 branch.

After backporting these changes in v0.10, test-abort-fatal-error is not
flaky anymore in environments for which it was flaky. It also has the
added benefit of being more robust because it checks exit codes and
signals instead of error messages.

Tested on OSX and SmartOS, the only platforms on which I could reproduce
the flakiness of this test.

This change also removes test-abort-fatal-error from the list of flaky
tests in test/simple/simple.status.

Fixes #25720.
  • Loading branch information
Julien Gilli committed Jul 23, 2015
1 parent a2f879f commit 76c69b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
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);
}
});

0 comments on commit 76c69b3

Please sign in to comment.