test: fix `net-socket-timeout-unref` flakiness
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Sat, 16 Jan 2016 00:54:44 +0000 (01:54 +0100)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
commit962c0e4e24ddae70a6316b87d77df897c73009d2
tree4b061db00c455069cfe5eb3eec2be06dfb816be6
parentc490464412bc1728097b76ba9f4b5b6fb5a08d54
test: fix `net-socket-timeout-unref` flakiness

From time to time this test is failing in OS X because at least one of
the connections takes quite a long time (around 5 seconds) causing some
of the timers may fire before the test exited. To solve this, wait for
all the connections to be established before setting the timeouts and
unrefing the sockets.

PR-URL: https://github.com/nodejs/node/pull/4772
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
test/parallel/test-net-socket-timeout-unref.js