Skip to content

Commit

Permalink
test: use mustCall() in pummel test
Browse files Browse the repository at this point in the history
Replace 'exit' check with common.mustCall().

PR-URL: #34327
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent 0ede223 commit bd3cef7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/pummel/test-net-connect-econnrefused.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit bd3cef7

Please sign in to comment.