From 620f55428d6224728784a5330b0ed7e684732133 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Mon, 10 Feb 2020 12:39:10 +0900 Subject: [PATCH] tests: sleep: Increase tick margin for Xilinx QEMU The Xilinx QEMU, used to emulate the Xilinx ZynqMP platform, is particularly unstable in terms of timing. This commit increases the tick margin for the Xilinx ZynqMP platform from 1 to 5 in order to allow the sleep test to pass with a reasonable repeatability. Signed-off-by: Stephanos Ioannidis --- tests/kernel/sleep/src/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/kernel/sleep/src/main.c b/tests/kernel/sleep/src/main.c index 02038c89045..7651a74f77b 100644 --- a/tests/kernel/sleep/src/main.c +++ b/tests/kernel/sleep/src/main.c @@ -24,7 +24,16 @@ #define ONE_SECOND_ALIGNED \ (u32_t)(k_ticks_to_ms_floor64(k_ms_to_ticks_ceil32(ONE_SECOND) + _TICK_ALIGN)) +#if defined(CONFIG_SOC_XILINX_ZYNQMP) +/* + * The Xilinx QEMU, used to emulate the Xilinx ZynqMP platform, is particularly + * unstable in terms of timing. The tick margin of at least 5 is necessary to + * allow this test to pass with a reasonable repeatability. + */ +#define TICK_MARGIN 5 +#else #define TICK_MARGIN 1 +#endif static struct k_sem test_thread_sem; static struct k_sem helper_thread_sem;