diff options
Diffstat (limited to 'cli/tests/unit/timers_test.ts')
-rw-r--r-- | cli/tests/unit/timers_test.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/tests/unit/timers_test.ts b/cli/tests/unit/timers_test.ts index 7312a6440..e85a2effc 100644 --- a/cli/tests/unit/timers_test.ts +++ b/cli/tests/unit/timers_test.ts @@ -397,10 +397,12 @@ Deno.test(async function timerMaxCpuBug() { clearTimeout(setTimeout(() => {}, 1000)); // We can check this by counting how many ops have triggered in the interim. // Certainly less than 10 ops should have been dispatched in next 100 ms. - const { opsDispatched } = Deno.metrics(); + const { ops: pre } = Deno.metrics(); await delay(100); - const opsDispatched_ = Deno.metrics().opsDispatched; - assert(opsDispatched_ - opsDispatched < 10); + const { ops: post } = Deno.metrics(); + const before = pre.op_sleep.opsDispatched; + const after = post.op_sleep.opsDispatched; + assert(after - before < 10); }); Deno.test(async function timerOrdering() { |