Browse Source

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 <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
v4.x
Santiago Gimeno 9 years ago
committed by Myles Borins
parent
commit
ab50e82f42
  1. 4
      test/parallel/test-process-exec-argv.js

4
test/parallel/test-process-exec-argv.js

@ -15,7 +15,7 @@ if (process.argv[2] === 'child') {
out += chunk; out += chunk;
}); });
child.on('exit', function() { child.on('close', function() {
assert.deepEqual(JSON.parse(out), execArgv); assert.deepStrictEqual(JSON.parse(out), execArgv);
}); });
} }

Loading…
Cancel
Save