summaryrefslogtreecommitdiff
path: root/tests/unit/timers_test.ts
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-03-01 11:15:18 -0700
committerGitHub <noreply@github.com>2024-03-01 11:15:18 -0700
commit736b91edd002ae34082c473b37249f9256a6ba32 (patch)
treed08c1dfde5777fef622750b166bcf4dc947d22ba /tests/unit/timers_test.ts
parent7ac040833025bf234dec485ddaa6c459b25d2196 (diff)
perf(cli): use new deno_core timers (#22569)
Improves #19100 Fixes #20356 Replaces #20428 Changes made in deno_core to support this: - [x] Errors must be handled in setTimeout callbacks - [x] Microtask ordering is not-quite-right - [x] Timer cancellation must be checked right before dispatch - [x] Timer sanitizer - [x] Move high-res timer to deno_core - [x] Timers need opcall tracing
Diffstat (limited to 'tests/unit/timers_test.ts')
-rw-r--r--tests/unit/timers_test.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/timers_test.ts b/tests/unit/timers_test.ts
index 17b137231..9e3b082dd 100644
--- a/tests/unit/timers_test.ts
+++ b/tests/unit/timers_test.ts
@@ -238,8 +238,8 @@ Deno.test(async function callbackTakesLongerThanInterval() {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 300);
timeEndOfFirstCallback = Date.now();
} else {
- // Second callback
- assert(Date.now() - 100 >= timeEndOfFirstCallback);
+ // Second callback should be nearly instantaneous
+ assert(Date.now() - timeEndOfFirstCallback < 10);
clearInterval(interval);
resolve();
}