diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 4da9dd12eefc0e..6cdd46635c9310 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -7,7 +7,6 @@ prefix parallel [true] # This section applies to all platforms [$system==win32] -test-cluster-net-send : PASS,FLAKY test-cluster-shared-leak : PASS,FLAKY test-debug-no-context : PASS,FLAKY test-tls-ticket-cluster : PASS,FLAKY diff --git a/test/parallel/test-cluster-net-send.js b/test/parallel/test-cluster-net-send.js index 6190fb517e4d1a..fe536b5f2a43c3 100644 --- a/test/parallel/test-cluster-net-send.js +++ b/test/parallel/test-cluster-net-send.js @@ -31,16 +31,22 @@ if (process.argv[2] !== 'child') { } else { console.error('[%d] worker', process.pid); + var socket; + var cbcalls = 0; + function socketConnected() { + if (++cbcalls === 2) + process.send('handle', socket); + } + var server = net.createServer(function(c) { process.once('message', function(msg) { assert.equal(msg, 'got'); c.end('hello'); }); + socketConnected(); }); server.listen(common.PORT, function() { - var socket = net.connect(common.PORT, '127.0.0.1', function() { - process.send('handle', socket); - }); + socket = net.connect(common.PORT, '127.0.0.1', socketConnected); }); process.on('disconnect', function() {