From 8d1d7809a98bcd48e617d5d8797a4eea31e6e49e 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 Ref: https://github.com/nodejs/node/pull/6575 PR-URL: https://github.com/nodejs/node/pull/7128 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- test/parallel/test-process-exec-argv.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index c2b663ac67eb60..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() { - assert.deepEqual(JSON.parse(out), execArgv); + child.on('close', function() { + assert.deepStrictEqual(JSON.parse(out), execArgv); }); }