Skip to content

Commit 8bebbd6

Browse files
TrottMylesBorins
authored andcommitted
test: fix test-net-connect-econnrefused (again)
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. PR-URL: #25438 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 0c33ecb commit 8bebbd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/pummel/test-net-connect-econnrefused.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function pummel() {
5050
function check() {
5151
setTimeout(function() {
5252
assert.strictEqual(process._getActiveRequests().length, 0);
53-
assert.strictEqual(process._getActiveHandles().length, 1); // the timer
53+
const activeHandles = process._getActiveHandles();
54+
assert.ok(activeHandles.every((val) => val.constructor.name !== 'Socket'));
5455
check_called = true;
5556
}, 0);
5657
}

0 commit comments

Comments
 (0)