Skip to content

Commit

Permalink
fix random fails on tests that use child process
Browse files Browse the repository at this point in the history
Listen to 'close' event rather than 'exit' event which can be fired before
stdio is closed.
  • Loading branch information
Oza94 committed Jul 9, 2015
1 parent d335b5a commit 339e59a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/hierarchy-test.js
Expand Up @@ -62,7 +62,7 @@ vows.describe('nconf/hierarchy').addBatch({
data += d;
});

child.on('exit', function () {
child.on('close', function () {
fs.readFile(configFile, 'utf8', that.callback.bind(null, null, data));
});
},
Expand Down Expand Up @@ -90,7 +90,7 @@ vows.describe('nconf/hierarchy').addBatch({
data += d;
});

child.on('exit', function() {
child.on('close', function() {
that.callback(null, data);
});
},
Expand Down

0 comments on commit 339e59a

Please sign in to comment.