From 874b75429f035e68f2e197a414df4fdcb4626a22 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 5 Dec 2024 17:18:20 +0100 Subject: [PATCH] tests: Fix random failure on too fast systems On mingw we are frequently getting a failure like this: [ ERROR ] --- 451 is not within the range 1-450 This means the 50ms sleep did not manage to elapse the 50ms in the timeout structure. Extending the range to 460 will give use more wiggle room if the clock is not as it should be. Related: #273 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- tests/unittests/torture_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c index b47c3c6b..662a7638 100644 --- a/tests/unittests/torture_misc.c +++ b/tests/unittests/torture_misc.c @@ -355,7 +355,7 @@ static void torture_timeout_update(void **state){ usleep(50000); assert_int_equal(ssh_timeout_update(&ts,25), 0); assert_in_range(ssh_timeout_update(&ts,30000),29000,29960); - assert_in_range(ssh_timeout_update(&ts,500),1,450); + assert_in_range(ssh_timeout_update(&ts,500),1,460); assert_int_equal(ssh_timeout_update(&ts,0),0); assert_int_equal(ssh_timeout_update(&ts,-1),-1); }