From 58dfeac1338308b47d53b185fd311a364fca557a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 12 Jul 2020 15:36:02 -0700 Subject: [PATCH] test: use mustCall() in pummel test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace 'exit' check with common.mustCall(). PR-URL: https://github.com/nodejs/node/pull/34327 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/pummel/test-net-connect-econnrefused.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index 39737f73bf0831..38a71b6cfd4944 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/test/pummel/test-net-connect-econnrefused.js @@ -48,17 +48,14 @@ function pummel() { } function check() { - setTimeout(function() { + setTimeout(common.mustCall(function() { assert.strictEqual(process._getActiveRequests().length, 0); const activeHandles = process._getActiveHandles(); assert.ok(activeHandles.every((val) => val.constructor.name !== 'Socket')); - check_called = true; - }, 0); + }), 0); } -let check_called = false; process.on('exit', function() { assert.strictEqual(rounds, ROUNDS); assert.strictEqual(reqs, ROUNDS * ATTEMPTS_PER_ROUND); - assert(check_called); });