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() {