From 00b37de243968ef826e4362e59a74a4ed8726d55 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sun, 20 Dec 2015 13:21:35 +0100 Subject: [PATCH] test: fix domain-top-level-error-handler-throw Check the stderr output in the `close` event as it's not guaranteed to be fully available when the `exit` event is fired. PR: #4364 PR-URL: https://github.com/nodejs/node/pull/4364 Reviewed-By: Julien Gilli --- test/parallel/test-domain-top-level-error-handler-throw.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-domain-top-level-error-handler-throw.js b/test/parallel/test-domain-top-level-error-handler-throw.js index 2b9e704e43c32b..8f63c94295a845 100644 --- a/test/parallel/test-domain-top-level-error-handler-throw.js +++ b/test/parallel/test-domain-top-level-error-handler-throw.js @@ -36,10 +36,12 @@ if (process.argv[2] === 'child') { stderrOutput += data.toString(); }); - child.on('exit', function onChildExited(exitCode, signal) { + child.on('close', function onChildClosed() { assert(stderrOutput.indexOf(domainErrHandlerExMessage) !== -1); assert(stderrOutput.indexOf(internalExMessage) === -1); + }); + child.on('exit', function onChildExited(exitCode, signal) { var expectedExitCode = 7; var expectedSignal = null;