>From 9413ff686affcb16ebf7619f4033687c8b5e0a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sun, 1 Mar 2020 22:28:29 +0000 Subject: [PATCH] tests: avoid a false failure on OpenIndiana 11 * tests/misc/timeout-parameters.sh: Detect the case where the kernel timer fires immediately when presented with a very large timeout. Reported by Bruno Haible. --- tests/misc/timeout-parameters.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/misc/timeout-parameters.sh b/tests/misc/timeout-parameters.sh index aa0599c9e..cceb09950 100755 --- a/tests/misc/timeout-parameters.sh +++ b/tests/misc/timeout-parameters.sh @@ -32,12 +32,11 @@ returns_ 125 timeout --kill-after=invalid 1 sleep 0 || fail=1 # invalid timeout suffix returns_ 125 timeout 42D sleep 0 || fail=1 -# It was seen on 32 bit Linux/HPPA that a kernel time_t overflowed, -# thus causing the timer to fire immediately. -# So verify that doesn't happen before checking large timeouts -KERNEL_OVERFLOW_LIMIT=$(expr $TIME_T_MAX - $(date +%s) + 100) || - skip_ "failed to adjust TIME_T_MAX $TIME_T_MAX" -timeout $KERNEL_OVERFLOW_LIMIT sleep 0 +# It was seen on 32 bit Linux/HPPA and OpenIndiana 11 +# that a kernel time_t overflowing cause the timer to fire immediately. +# This is still racy, but unlikely to cause an issue unless +# timeout can't process the timer firing within 2 seconds. +timeout $TIME_T_OFLOW sleep 2 if test $? != 124; then # timeout overflow timeout $UINT_OFLOW sleep 0 || fail=1 -- 2.24.1