From eef83d3e849743911b29133e6ef873f7e0d34c1c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 Nov 2022 10:10:04 +0100 Subject: tests: relax sleep() test Invoking `sleep(1000)` in the CI container often sleeps slightly longer than exactly 1000ms, causing the test output to mismatch. Relax the test requirement to simply ensure that t2 > t1. Signed-off-by: Jo-Philipp Wich --- tests/custom/03_stdlib/41_sleep | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/custom/03_stdlib/41_sleep b/tests/custom/03_stdlib/41_sleep index bca6f0d..0f918d3 100644 --- a/tests/custom/03_stdlib/41_sleep +++ b/tests/custom/03_stdlib/41_sleep @@ -14,12 +14,15 @@ negative or zero. let t2 = time(); - printf("Slept for %d second(s).\n", t2 - t1); + if (t2 > t1) + printf("Slept for at least one second.\n"); + else + printf("Unexpected time delta: %d\n", t2 - t1); %} -- End -- -- Expect stdout -- -Slept for 1 second(s). +Slept for at least one second. -- End -- -- cgit v1.2.3