test: fix cluster-worker-wait-server-close races
authorSam Roberts <sam@strongloop.com>
Thu, 11 Jun 2015 21:43:09 +0000 (14:43 -0700)
committerSam Roberts <sam@strongloop.com>
Fri, 12 Jun 2015 19:56:40 +0000 (12:56 -0700)
commit03ce84dfa13a1cc075bb45772a8a566213148939
tree03a54787631f921104e7923d53f8d34cda60fd73
parent2a7fd0ad328d5197a9a166650e9eaa51367e3152
test: fix cluster-worker-wait-server-close races

Wait for data to arrive from worker before doing a disconnect. Without
this, whether the disconnect arrives at the worker before the master
accepts and forwards the connection descriptor to the worker is a race.

Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: https://github.com/nodejs/io.js/pull/1953
Fixes: https://github.com/nodejs/io.js/issues/1933
Fixes: https://github.com/nodejs/io.js/pull/1400
test/parallel/test-cluster-worker-wait-server-close.js