summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-01-10 14:04:52 -0800
committerRich Trott <rtrott@gmail.com>2019-01-12 16:21:41 -0800
commitc24fccf06460581a8b788ca4784bfef89eedf8f1 (patch)
treec38147903bae5937d4751deca17af9e264e42653 /test
parent4da7e6e228766454912a4de5dc6f037da8223e53 (diff)
downloadandroid-node-v8-c24fccf06460581a8b788ca4784bfef89eedf8f1.tar.gz
android-node-v8-c24fccf06460581a8b788ca4784bfef89eedf8f1.tar.bz2
android-node-v8-c24fccf06460581a8b788ca4784bfef89eedf8f1.zip
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 <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>
Diffstat (limited to 'test')
-rw-r--r--test/pummel/test-net-connect-econnrefused.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js
index e222f6c819..0f350bd572 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);
}