From 7f5b89c30760fc7dc5d1c3ea7964c2730765bdba Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 21 Mar 2020 17:49:45 -0700 Subject: [PATCH] test: use mustCall in place of countdown in timers test Use common.mustCall() in place of countdown in test-timers-immediate-unref. PR-URL: https://github.com/nodejs/node/pull/32416 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- test/parallel/test-timers-immediate-unref.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-timers-immediate-unref.js b/test/parallel/test-timers-immediate-unref.js index 5a7629781d54f5..fa9fd9aa55c661 100644 --- a/test/parallel/test-timers-immediate-unref.js +++ b/test/parallel/test-timers-immediate-unref.js @@ -1,8 +1,6 @@ 'use strict'; const common = require('../common'); -const Countdown = require('../common/countdown'); - const assert = require('assert'); const immediate = setImmediate(() => {}); @@ -16,12 +14,10 @@ clearImmediate(immediate); setImmediate(common.mustCall(firstStep)).ref().unref().unref().ref(); function firstStep() { - const countdown = - new Countdown(2, common.mustCall(() => setImmediate(secondStep))); // Unrefed setImmediate executes if it was unrefed but something else keeps // the loop open - setImmediate(() => countdown.dec()).unref(); - setTimeout(() => countdown.dec(), 50); + setImmediate(common.mustCall()).unref(); + setTimeout(common.mustCall(() => { setImmediate(secondStep); }), 0); } function secondStep() {