From 89b25fac4ce6c4573bcf7bb2eece52e50e454991 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Tue, 3 May 2016 13:22:53 +0200 Subject: [PATCH] test: fix test-process-exec-argv flakiness Wait for the `close` event before parsing the child stdout output. Fixes: https://github.com/nodejs/node/issues/6480 PR-URL: https://github.com/nodejs/node/pull/6575 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- test/parallel/test-process-exec-argv.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index 282bfdf51a15e7..178b84c23fcc70 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -15,7 +15,7 @@ if (process.argv[2] === 'child') { out += chunk; }); - child.on('exit', function() { + child.on('close', function() { assert.deepStrictEqual(JSON.parse(out), execArgv); }); }