-
Notifications
You must be signed in to change notification settings - Fork 7.3k
test: fix test-process-active-wraps.js #8998
Conversation
b636ba8 broke this test, because it now takes a loop iteration or two to resolve the loopback address. That consequence is that the TCPWrap handle that we *don't* want to see is created a bit later, and also destroyed later, so when we assert that the active handle list is empty the TCPWrap object is still "busy" being closed. Wait one extra loop iteration before checking there are no more active handles. This allows name resolution and clean-up to finish before the assertion. BUG: #246 PR-URL: nodejs/node-v0.x-archive#8998 Reviewed-By: Bert Belder <[email protected]>
LGTM, landed in nodejs/node@b5c9dcb |
setImmediate(function() { | ||
assert.equal(process._getActiveHandles().length, 0); | ||
}); | ||
// give server handle a chance to close - see GH #8986 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could add to this comment (or at the beginning of this file, as a general comment) that this test depends a lot on the implementation of how handles are closed, and as such can and will likely break in the future?
We could add a note saying that if the test breaks, it may be because of a correct change in the way handles are closed, and it doesn't necessarily mean that node is broken.
It may save us some time next time this test breaks.
@cjihrig Except for my inline comment, LGTM. |
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.
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 <[email protected]> Reviewed-By: Bert Belder <[email protected]>
Thanks! @misterdjules I updated the comment as you asked. Landed in 1fad373 |
@cjihrig @piscisaureus Thanks you! |
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. Closes #8986.
cc: @piscisaureus @misterdjules