From 339e59afd5b5566bf7102e4e51df5f39f6f1282c Mon Sep 17 00:00:00 2001 From: Pierre Beaujeu Date: Thu, 9 Jul 2015 17:33:52 +0200 Subject: [PATCH] fix random fails on tests that use child process Listen to 'close' event rather than 'exit' event which can be fired before stdio is closed. --- test/hierarchy-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hierarchy-test.js b/test/hierarchy-test.js index 2c0ec12..76566d5 100644 --- a/test/hierarchy-test.js +++ b/test/hierarchy-test.js @@ -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)); }); }, @@ -90,7 +90,7 @@ vows.describe('nconf/hierarchy').addBatch({ data += d; }); - child.on('exit', function() { + child.on('close', function() { that.callback(null, data); }); },