Skip to content

Commit

Permalink
test: fix test-net-connect-econnrefused (again)
Browse files Browse the repository at this point in the history
test-net-connect-econnrefused was recently fixed, but only in certain
circumstances. This change allows it to succeed whether it is invoked
with `node` or `tools/test.py`. Makes sure no Socket handles are left,
which is what the test is trying to determine, rather than failing if
there are no handles of any kind left.
  • Loading branch information
Trott committed Jan 11, 2019
1 parent b2f74f7 commit ba7fb34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/pummel/test-net-connect-econnrefused.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function pummel() {
function check() {
setTimeout(function() {
assert.strictEqual(process._getActiveRequests().length, 0);
assert.strictEqual(process._getActiveHandles().length, 1); // the timer
const activeHandles = process._getActiveHandles();
assert.ok(activeHandles.every((val) => val.constructor.name !== 'Socket'));
check_called = true;
}, 0);
}
Expand Down

0 comments on commit ba7fb34

Please sign in to comment.