From ed0d76552b83e20fd20cce2d3bf8b2a78e4e7a4f Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 7 Jun 2019 11:39:45 +0200 Subject: [PATCH] Relax timing requirements in lazy timer test The lazy-timer test depends on the faster-timer handler to be executed before the fast timeout occurs, which was pretty hard to achieve on Qemu and a busy host machine. Therefore, I increased the fast-to-faster timeout ratio from 50/25 ms to 200/25 ms and set the test runtime to 4000 ms. --- repos/base/src/test/timer/main.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/repos/base/src/test/timer/main.cc b/repos/base/src/test/timer/main.cc index 9040c23b8e..7b5e2c2cc0 100644 --- a/repos/base/src/test/timer/main.cc +++ b/repos/base/src/test/timer/main.cc @@ -37,7 +37,7 @@ struct Lazy_test Signal_handler faster_handler { env.ep(), *this, &Lazy_test::handle_faster_timer }; - enum { RUN_TIME_US = 2 * 1000 * 1000, TIMEOUT_US = 50*1000, FACTOR = 2 }; + enum { RUN_TIME_US = 4*1000*1000, TIMEOUT_US = 200*1000, FACTOR = 8 }; unsigned fast = 0; unsigned faster = 0; @@ -52,7 +52,8 @@ struct Lazy_test done.submit(); } - void handle_fast_timer() { + void handle_fast_timer() + { fast ++; if (faster <= fast) throw Faster_timer_too_slow(); @@ -73,7 +74,7 @@ struct Lazy_test fast_timer.sigh(fast_handler); faster_timer.sigh(faster_handler); - log("register two-seconds timeout..."); + log("register ", RUN_TIME_US/1000/1000, "-seconds timeout..."); slow_timer.trigger_once(RUN_TIME_US); set_fast_timers(); }