From 23d41fbf01b9992da720b917c0222dfc9a8111fc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 10 Jan 2019 14:04:52 -0800 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/25438 Reviewed-By: Daniel Bevenius Reviewed-By: Beth Griggs Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- test/pummel/test-net-connect-econnrefused.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index e222f6c819eb1a..0f350bd572f177 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/test/pummel/test-net-connect-econnrefused.js @@ -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); }