| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6809c2b commit a256790
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ prefix parallel | |||
| 7 | 7 | [true] # This section applies to all platforms | |
| 8 | 8 | ||
| 9 | 9 | [$system==win32] | |
| 10 | - test-cluster-net-send : PASS,FLAKY | ||
| 11 | 10 | test-cluster-shared-leak : PASS,FLAKY | |
| 12 | 11 | test-debug-no-context : PASS,FLAKY | |
| 13 | 12 | test-tls-ticket-cluster : PASS,FLAKY | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,16 +31,22 @@ if (process.argv[2] !== 'child') { | |||
| 31 | 31 | } else { | |
| 32 | 32 | console.error('[%d] worker', process.pid); | |
| 33 | 33 | ||
| 34 | + var socket; | ||
| 35 | + var cbcalls = 0; | ||
| 36 | + function socketConnected() { | ||
| 37 | + if (++cbcalls === 2) | ||
| 38 | + process.send('handle', socket); | ||
| 39 | + } | ||
| 40 | + | ||
| 34 | 41 | var server = net.createServer(function(c) { | |
| 35 | 42 | process.once('message', function(msg) { | |
| 36 | 43 | assert.equal(msg, 'got'); | |
| 37 | 44 | c.end('hello'); | |
| 38 | 45 | }); | |
| 46 | + socketConnected(); | ||
| 39 | 47 | }); | |
| 40 | 48 | server.listen(common.PORT, function() { | |
| 41 | - var socket = net.connect(common.PORT, '127.0.0.1', function() { | ||
| 42 | - process.send('handle', socket); | ||
| 43 | - }); | ||
| 49 | + socket = net.connect(common.PORT, '127.0.0.1', socketConnected); | ||
| 44 | 50 | }); | |
| 45 | 51 | ||
| 46 | 52 | process.on('disconnect', function() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments