summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-17 13:02:32 -0400
committerGitHub <noreply@github.com>2019-04-17 13:02:32 -0400
commit1a69df4a051b9407ab341a82d65d4355f77ad16b (patch)
tree5b58a90c9b3123963443dc1886db0d8b75a7fa57 /js
parentf20b05af24a5e1308e240f2c9af0fa75eefb131f (diff)
Fix flaky tests (#2139)
Diffstat (limited to 'js')
-rw-r--r--js/timers_test.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/js/timers_test.ts b/js/timers_test.ts
index d1bce82a9..b43817437 100644
--- a/js/timers_test.ts
+++ b/js/timers_test.ts
@@ -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);
});