Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
fix race in test-http-big-proxy-responses.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 18, 2010
1 parent 5908bda commit 2219c64
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/disabled/test-http-big-proxy-responses.js
Expand Up @@ -18,7 +18,7 @@ var chargen = http.createServer(function (req, res) {
}
res.end();
});
chargen.listen(9000);
chargen.listen(9000, ready);

// Proxy to the chargen server.
var proxy = http.createServer(function (req, res) {
Expand Down Expand Up @@ -56,7 +56,7 @@ var proxy = http.createServer(function (req, res) {

proxy_req.end();
});
proxy.listen(9001);
proxy.listen(9001, ready);

var done = false;

Expand Down Expand Up @@ -94,7 +94,11 @@ function call_chargen(list) {
}
}

call_chargen([ 100, 1000, 10000, 100000, 1000000 ]);
serversRunning = 0;
function ready () {
if (++serversRunning < 2) return;
call_chargen([ 100, 1000, 10000, 100000, 1000000 ]);
}

process.addListener('exit', function () {
assert.ok(done);
Expand Down

0 comments on commit 2219c64

Please sign in to comment.