Browse Source

test: Fix premature close in test-http-client-timeout-agent

v0.8.10-release
isaacs 12 years ago
parent
commit
ea2ceb731c
  1. 13
      test/simple/test-http-client-timeout-agent.js

13
test/simple/test-http-client-timeout-agent.js

@ -78,9 +78,16 @@ server.listen(options.port, options.host, function() {
});
req.end();
}
setTimeout(function() {
server.close();
}, 150);
setTimeout(function maybeDone() {
if (requests_done >= requests_sent) {
setTimeout(function() {
server.close();
}, 100);
} else {
setTimeout(maybeDone, 100);
}
}, 100);
});
process.on('exit', function() {

Loading…
Cancel
Save