summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/http_test.ts2
-rw-r--r--cli/tests/unit/timers_test.ts8
2 files changed, 6 insertions, 4 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index 2682ccee6..5ff1475b3 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -868,7 +868,7 @@ Deno.test(
const readable = new ReadableStream({
async pull(controller) {
client.close();
- await delay(100);
+ await delay(1000);
controller.enqueue(new TextEncoder().encode(
"written to the writable side of a TransformStream",
));
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() {