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.
This commit is contained in:
@@ -37,7 +37,7 @@ struct Lazy_test
|
|||||||
Signal_handler<Lazy_test> faster_handler { env.ep(), *this,
|
Signal_handler<Lazy_test> faster_handler { env.ep(), *this,
|
||||||
&Lazy_test::handle_faster_timer };
|
&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 fast = 0;
|
||||||
unsigned faster = 0;
|
unsigned faster = 0;
|
||||||
|
|
||||||
@@ -52,7 +52,8 @@ struct Lazy_test
|
|||||||
done.submit();
|
done.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_fast_timer() {
|
void handle_fast_timer()
|
||||||
|
{
|
||||||
fast ++;
|
fast ++;
|
||||||
if (faster <= fast)
|
if (faster <= fast)
|
||||||
throw Faster_timer_too_slow();
|
throw Faster_timer_too_slow();
|
||||||
@@ -73,7 +74,7 @@ struct Lazy_test
|
|||||||
fast_timer.sigh(fast_handler);
|
fast_timer.sigh(fast_handler);
|
||||||
faster_timer.sigh(faster_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);
|
slow_timer.trigger_once(RUN_TIME_US);
|
||||||
set_fast_timers();
|
set_fast_timers();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user