Browse Source

test-net-timeout: make it pass on Windows

The test didn't take into account that some time might pass before
libuv makes close callbacks. This is now fixed.
v0.9.1-release
Bert Belder 13 years ago
parent
commit
5209dad907
  1. 11
      test/gc/test-net-timeout.js

11
test/gc/test-net-timeout.js

@ -56,9 +56,14 @@ function status() {
console.log('Done: %d/%d', done, todo);
console.log('Collected: %d/%d', countGC, count);
if (done === todo) {
console.log('All should be collected now.');
assert(count === countGC);
process.exit(0);
/* Give libuv some time to make close callbacks. */
setTimeout(function() {
gc();
console.log('All should be collected now.');
console.log('Collected: %d/%d', countGC, count);
assert(count === countGC);
process.exit(0);
}, 200);
}
}

Loading…
Cancel
Save