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

Commit

Permalink
test-net-timeout: make it pass on Windows
Browse files Browse the repository at this point in the history
The test didn't take into account that some time might pass before
libuv makes close callbacks. This is now fixed.
  • Loading branch information
piscisaureus committed Jun 13, 2012
1 parent e4f4c63 commit 5209dad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/gc/test-net-timeout.js
Expand Up @@ -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);
}
}

0 comments on commit 5209dad

Please sign in to comment.