From e66b29d8dfe749c438ed574e2e986a06d8b20e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 15 Mar 2020 20:38:44 +0100 Subject: [PATCH] Loosen test timing to pass on Windows on the CI infrastructure. --- tests/0-timer.d | 4 ++-- tests/issue-25-periodic-timers.d | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/0-timer.d b/tests/0-timer.d index 20cf63b..d8a7127 100644 --- a/tests/0-timer.d +++ b/tests/0-timer.d @@ -26,7 +26,7 @@ void main() } try { - assert(dur > 1200.msecs, (dur - 1200.msecs).toString()); + assert(dur > 1200.msecs - 2.msecs, (dur - 1200.msecs).toString()); assert(dur < 1300.msecs, (dur - 1200.msecs).toString()); } catch (Exception e) assert(false, e.msg); @@ -38,7 +38,7 @@ void main() try { auto dur = MonoTime.currTime() - s_startTime; s_cnt++; - assert(dur > 300.msecs * s_cnt, (dur - 300.msecs * s_cnt).toString()); + assert(dur > 300.msecs * s_cnt - 2.msecs, (dur - 300.msecs * s_cnt).toString()); assert(dur < 300.msecs * s_cnt + 100.msecs, (dur - 300.msecs * s_cnt).toString()); assert(s_cnt <= 3); diff --git a/tests/issue-25-periodic-timers.d b/tests/issue-25-periodic-timers.d index bc14b0c..bc3736d 100644 --- a/tests/issue-25-periodic-timers.d +++ b/tests/issue-25-periodic-timers.d @@ -44,7 +44,7 @@ void main() auto dur = MonoTime.currTime() - s_startTime; s_cnt++; - assert(dur > 300.msecs * s_cnt, (dur - 300.msecs * s_cnt).toString()); + assert(dur > 300.msecs * s_cnt - 2.msecs, (dur - 300.msecs * s_cnt).toString()); assert(dur < 300.msecs * s_cnt + 100.msecs, (dur - 300.msecs * s_cnt).toString()); assert(s_cnt <= 5);