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 <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Jul 16, 2020
1 parent 02ea320 commit 58dfeac
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 58dfeac

Please sign in to comment.