Skip to content

Commit

Permalink
test: add test-child-process-emfile fail message
Browse files Browse the repository at this point in the history
When the test fails (as it does frequently on FreeBSD unfortunately)
provide a non-cryptic error message that also provides a line number.

PR-URL: #3335
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Trott committed Oct 14, 2015
1 parent 2d35607 commit e3d9d25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/sequential/test-child-process-emfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ proc.on('error', common.mustCall(function(err) {
assert(err.code === 'EMFILE' || err.code === 'ENFILE');
}));

// 'exit' should not be emitted, the process was never spawned.
proc.on('exit', assert.fail);
proc.on('exit', function() {
const msg = '"exit" should not be emitted (the process never spawned!)';
assert.fail(null, null, msg);
});

// close one fd for LSan
if (openFds.length >= 1) {
Expand Down

0 comments on commit e3d9d25

Please sign in to comment.