From 1a69df4a051b9407ab341a82d65d4355f77ad16b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 17 Apr 2019 13:02:32 -0400 Subject: Fix flaky tests (#2139) --- js/timers_test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'js') 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); }); -- cgit v1.2.3