1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

Fix flaky tests (#2139)

This commit is contained in:
Ryan Dahl 2019-04-17 13:02:32 -04:00 committed by GitHub
parent f20b05af24
commit 1a69df4a05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 17 deletions

View file

@ -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);
});

View file

@ -1,2 +0,0 @@
args: --reload tests/010_set_interval.ts
output: tests/010_set_interval.ts.out

View file

@ -1,7 +0,0 @@
const id = setInterval(() => {
console.log("test");
}, 200);
setTimeout(() => {
clearInterval(id);
}, 500);

View file

@ -1,2 +0,0 @@
test
test