summaryrefslogtreecommitdiff
path: root/test/gc/test-http-client-connaborted.js
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-02-24 10:20:30 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-02-24 11:52:47 -0800
commitaf1418325bac37f70b57580eec98ee211e11c2dd (patch)
tree511b4021b2147d8f888b9c4dcb1633e0f8924433 /test/gc/test-http-client-connaborted.js
parentdbae8b569fd1afa04cddac47b30379e4ebf3388a (diff)
downloadnode-new-af1418325bac37f70b57580eec98ee211e11c2dd.tar.gz
test: backoff client connection rates
We were being very aggressive in our connection creations, resulting in the pipeline flood detection to drop us. Relax how fast we're creating these connections so the gc can run all its tests.
Diffstat (limited to 'test/gc/test-http-client-connaborted.js')
-rw-r--r--test/gc/test-http-client-connaborted.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/test/gc/test-http-client-connaborted.js b/test/gc/test-http-client-connaborted.js
index 80ac055109..4fbb429298 100644
--- a/test/gc/test-http-client-connaborted.js
+++ b/test/gc/test-http-client-connaborted.js
@@ -22,25 +22,31 @@ var server = http.createServer(serverHandler);
server.listen(PORT, getall);
function getall() {
- for (var i = 0; i < todo; i++) {
- (function(){
- function cb(res) {
- done+=1;
- statusLater();
- }
+ if (count >= todo)
+ return;
- var req = http.get({
- hostname: 'localhost',
- pathname: '/',
- port: PORT
- }, cb).on('error', cb);
+ (function(){
+ function cb(res) {
+ done+=1;
+ statusLater();
+ }
- count++;
- weak(req, afterGC);
- })()
- }
+ var req = http.get({
+ hostname: 'localhost',
+ pathname: '/',
+ port: PORT
+ }, cb).on('error', cb);
+
+ count++;
+ weak(req, afterGC);
+ })()
+
+ setImmediate(getall);
}
+for (var i = 0; i < 10; i++)
+ getall();
+
function afterGC(){
countGC ++;
}