test: fix flaky cluster-net-send
authorBrian White <mscdex@mscdex.net>
Mon, 28 Dec 2015 06:11:51 +0000 (01:11 -0500)
committerMyles Borins <mborins@us.ibm.com>
Mon, 15 Feb 2016 19:30:23 +0000 (11:30 -0800)
commita256790327c0db64c414e400e05f7fa5623f70fc
tree8f69581be9a35ef5153f68b68730598a00747887
parent6809c2be1a32024cd34d06bfa4cee962c972a86c
test: fix flaky cluster-net-send

Before this commit, it was possible on Windows for the server's
'connection' handler to be called *after* the client socket's
'connect' handler. This caused the 'message' event to be missed
and the test would never end (timing out in CI). This problem
was more easily reproducible on a low resource (slow CPU)
Windows (2012r2) installation.

This commit waits until both handlers have been called before
sending the handle to the master process.

Fixes: https://github.com/nodejs/node/issues/3957
PR-URL: https://github.com/nodejs/node/pull/4444
Reviewed-By: Rich Trott <rtrott@gmail.com>
test/parallel/parallel.status
test/parallel/test-cluster-net-send.js