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

Commit

Permalink
test: Fix premature close in test-http-client-timeout-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 25, 2012
1 parent 411d460 commit ea2ceb7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/simple/test-http-client-timeout-agent.js
Expand Up @@ -78,9 +78,16 @@ server.listen(options.port, options.host, function() {
}); });
req.end(); req.end();
} }
setTimeout(function() {
server.close(); setTimeout(function maybeDone() {
}, 150); if (requests_done >= requests_sent) {
setTimeout(function() {
server.close();
}, 100);
} else {
setTimeout(maybeDone, 100);
}
}, 100);
}); });


process.on('exit', function() { process.on('exit', function() {
Expand Down

0 comments on commit ea2ceb7

Please sign in to comment.