]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
iconv: Use TIMEOUTFACTOR for iconv test timeout
authorStafford Horne <shorne@gmail.com>
Tue, 5 Oct 2021 01:56:10 +0000 (10:56 +0900)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 21 Oct 2021 14:11:07 +0000 (11:11 -0300)
Currently the timeout for each iconv test is hard coded to 3 seconds.
On my OpenRISC test platform this is too slow and the test fails with a
HANG error.

This change uses the available TIMEOUTFACTOR to compute the timeout.
The default value is still 3.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
iconv/tst-iconv_prog.sh

index 14b7c08c9152be1b9c0141116b15e96d9d2c1b67..2505f0f37163be4d82061d92793993a11f76635e 100644 (file)
@@ -32,6 +32,8 @@ $codir/iconv/iconv_prog
 '
 ICONV="$test_wrapper_env $run_program_env $ICONV"
 
+TIMEOUTFACTOR=${TIMEOUTFACTOR:-1}
+
 # List of known hangs;
 # Gathered by running an exhaustive 2 byte input search against glibc-2.28
 hangarray=(
@@ -222,7 +224,8 @@ execute_test ()
 {
   eval PROG=\"$ICONV\"
   echo -en "$twobyte" \
-    | timeout -k 4 3 $PROG $c -f $from -t "$to" &>/dev/null
+    | timeout -k 4 $((3*$TIMEOUTFACTOR)) \
+      $PROG $c -f $from -t "$to" &>/dev/null
   ret=$?
 }