From 306f82e85b3d9e596eed38d36cbef369643515c0 Mon Sep 17 00:00:00 2001 From: "Sergey G. Grekhov" Date: Fri, 10 Nov 2023 10:25:59 +0200 Subject: [PATCH] #2361. Improve some flaky tests on Web (#2364) --- LibTest/async/Future/Future.delayed_A01_t02.dart | 10 ++++++---- LibTest/async/Stream/Stream.periodic_A01_t01.dart | 2 ++ LibTest/async/Timer/Timer_A01_t01.dart | 4 ++++ LibTest/html/Element/onMouseOver_A01_t01.dart | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/LibTest/async/Future/Future.delayed_A01_t02.dart b/LibTest/async/Future/Future.delayed_A01_t02.dart index 3a22b3cf65..06b725528a 100644 --- a/LibTest/async/Future/Future.delayed_A01_t02.dart +++ b/LibTest/async/Future/Future.delayed_A01_t02.dart @@ -22,7 +22,7 @@ Duration safetyMargin = const bool.fromEnvironment('dart.library.js') ? Duration(milliseconds: 40) : Duration.zero; -check(delayms, value) { +check(delayms) { Duration delay = durationInMilliseconds(delayms); Stopwatch sw = new Stopwatch(); asyncStart(); @@ -36,7 +36,9 @@ check(delayms, value) { } main() { - check(0, 11); - check(300, 3); - check(50, 22); + check(0); + check(30); + check(50); + check(100); + check(150); } diff --git a/LibTest/async/Stream/Stream.periodic_A01_t01.dart b/LibTest/async/Stream/Stream.periodic_A01_t01.dart index 97a351b618..061eed45d6 100644 --- a/LibTest/async/Stream/Stream.periodic_A01_t01.dart +++ b/LibTest/async/Stream/Stream.periodic_A01_t01.dart @@ -50,5 +50,7 @@ main() { check(1); check(10); check(30); + check(50); check(100); + check(200); } diff --git a/LibTest/async/Timer/Timer_A01_t01.dart b/LibTest/async/Timer/Timer_A01_t01.dart index 311fae7e67..25905912f8 100644 --- a/LibTest/async/Timer/Timer_A01_t01.dart +++ b/LibTest/async/Timer/Timer_A01_t01.dart @@ -35,10 +35,14 @@ check(int delayms) { } main() { + check(150); + check(100); + check(50); check(25); check(10); check(2); check(1); check(0); check(-5); + check(-50); } diff --git a/LibTest/html/Element/onMouseOver_A01_t01.dart b/LibTest/html/Element/onMouseOver_A01_t01.dart index 119b2cd056..f3419e23d5 100644 --- a/LibTest/html/Element/onMouseOver_A01_t01.dart +++ b/LibTest/html/Element/onMouseOver_A01_t01.dart @@ -20,6 +20,7 @@ main() { Expect.equals(type, e.type); if (!fired) { asyncEnd(); + fired = true; } }); var event = new MouseEvent(type);