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

Commit

Permalink
test: fix test-process-active-wraps.js
Browse files Browse the repository at this point in the history
b636ba8 caused a regression
on Windows due to the way server handles are cleaned up. This
commit fixes the test by allowing the handle to be cleaned up.

Fixes: #8986
PR-URL: #8998
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
  • Loading branch information
cjihrig committed Jan 8, 2015
1 parent c8ef97e commit 1fad373
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/simple/test-process-active-wraps.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var handles = [];

expect(1, 0);
var conn = net.createConnection(common.PORT);
conn.on('lookup', onlookup);
conn.on('lookup', onlookup);
conn.on('error', function() { assert(false); });
expect(2, 1);
conn.destroy();
Expand All @@ -65,8 +65,14 @@ var handles = [];
});
function onclose() {
if (++n === handles.length) {
// Allow the server handle a few loop iterations to wind down.
// This test is highly dependent on the implementation of handle
// closing. If this test breaks in the future, it does not
// necessarily mean that Node is broken.
setImmediate(function() {
assert.equal(process._getActiveHandles().length, 0);
setImmediate(function() {
assert.equal(process._getActiveHandles().length, 0);
});
});
}
}
Expand Down

0 comments on commit 1fad373

Please sign in to comment.