mirror of
https://github.com/denoland/deno
synced 2024-08-25 02:57:22 +00:00
Fix flaky tests (#2139)
This commit is contained in:
parent
f20b05af24
commit
1a69df4a05
|
@ -132,11 +132,9 @@ test(async function intervalCancelSuccess() {
|
|||
let count = 0;
|
||||
const id = setInterval(() => {
|
||||
count++;
|
||||
}, 500);
|
||||
// Cancelled, count should not increment
|
||||
}, 1);
|
||||
clearInterval(id);
|
||||
// Wait a bit longer than 500ms
|
||||
await waitForMs(600);
|
||||
await waitForMs(500);
|
||||
assertEquals(count, 0);
|
||||
});
|
||||
|
||||
|
@ -150,9 +148,9 @@ test(async function intervalOrdering() {
|
|||
}
|
||||
}
|
||||
for (let i = 0; i < 10; i++) {
|
||||
timers[i] = setTimeout(onTimeout, 20);
|
||||
timers[i] = setTimeout(onTimeout, 1);
|
||||
}
|
||||
await waitForMs(100);
|
||||
await waitForMs(500);
|
||||
assertEquals(timeouts, 1);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
args: --reload tests/010_set_interval.ts
|
||||
output: tests/010_set_interval.ts.out
|
|
@ -1,7 +0,0 @@
|
|||
const id = setInterval(() => {
|
||||
console.log("test");
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(id);
|
||||
}, 500);
|
|
@ -1,2 +0,0 @@
|
|||
test
|
||||
test
|
Loading…
Reference in a new issue