Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up gc tests

This fixes the additional issues brought up in #3179.
  • Loading branch information...
commit 62c12d21612ee0c9a6892c585eea83a02cb8de63 1 parent e3ceee2
@isaacs isaacs authored
View
7 test/gc/test-http-client-connaborted.js
@@ -10,7 +10,7 @@ var http = require('http'),
done = 0,
count = 0,
countGC = 0,
- todo = 18,
+ todo = 500,
common = require('../common.js'),
assert = require('assert'),
PORT = common.PORT;
@@ -45,8 +45,11 @@ function afterGC(){
countGC ++;
}
+var timer;
function statusLater() {
- setTimeout(status, 1);
+ gc();
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(status, 1);
}
function status() {
View
7 test/gc/test-http-client-onerror.js
@@ -11,7 +11,7 @@ var http = require('http'),
done = 0,
count = 0,
countGC = 0,
- todo = 18,
+ todo = 500,
common = require('../common.js'),
assert = require('assert'),
PORT = common.PORT;
@@ -49,8 +49,11 @@ function afterGC(){
countGC ++;
}
+var timer;
function statusLater() {
- setTimeout(status, 1);
+ gc();
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(status, 1);
}
function status() {
View
7 test/gc/test-http-client-timeout.js
@@ -13,7 +13,7 @@ var http = require('http'),
done = 0,
count = 0,
countGC = 0,
- todo = 18,
+ todo = 500,
common = require('../common.js'),
assert = require('assert'),
PORT = common.PORT;
@@ -52,8 +52,11 @@ function afterGC(){
countGC ++;
}
+var timer;
function statusLater() {
- setTimeout(status, 1);
+ gc();
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(status, 1);
}
function status() {
View
8 test/gc/test-http-client.js
@@ -10,7 +10,7 @@ var http = require('http'),
done = 0,
count = 0,
countGC = 0,
- todo = 5,
+ todo = 500,
common = require('../common.js'),
assert = require('assert'),
PORT = common.PORT;
@@ -47,8 +47,11 @@ function afterGC(){
countGC ++;
}
+var timer;
function statusLater() {
- setTimeout(status, 1);
+ gc();
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(status, 1);
}
function status() {
@@ -61,3 +64,4 @@ function status() {
process.exit(0);
}
}
+
View
9 test/gc/test-net-timeout.js
@@ -13,7 +13,7 @@ var net = require('net'),
done = 0,
count = 0,
countGC = 0,
- todo = 18,
+ todo = 500,
common = require('../common.js'),
assert = require('assert'),
PORT = common.PORT;
@@ -36,7 +36,7 @@ function getall() {
count++;
weak(req, afterGC);
- })()
+ })();
}
}
@@ -44,8 +44,11 @@ function afterGC(){
countGC ++;
}
+var timer;
function statusLater() {
- setTimeout(status, 1);
+ gc();
+ if (timer) clearTimeout(timer);
+ timer = setTimeout(status, 1);
}
function status() {
Please sign in to comment.
Something went wrong with that request. Please try again.