Skip to content

Commit 23d41fb

Browse files
Trottaddaleax
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 <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 5fe7741 commit 23d41fb

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)