diff mbox series

iconv: Use TIMEOUTFACTOR for iconv test timeout

Message ID 20211005015610.2067161-1-shorne@gmail.com
State Committed
Commit 0ff2d30daedb6d0d00401f1f2a48a80ff99d7c25
Delegated to: Adhemerval Zanella Netto
Headers show
Series iconv: Use TIMEOUTFACTOR for iconv test timeout | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Stafford Horne Oct. 5, 2021, 1:56 a.m. UTC
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.
---
 iconv/tst-iconv_prog.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Stafford Horne Oct. 20, 2021, 9:22 p.m. UTC | #1
Ping,

And by the way, Am I allowed to push upstream trivial fixes like this
without review?  I think reviewing should be mandatory, but some
projects feel different.

On Tue, Oct 5, 2021 at 10:56 AM Stafford Horne <shorne@gmail.com> wrote:
>
> 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.
> ---
>  iconv/tst-iconv_prog.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/iconv/tst-iconv_prog.sh b/iconv/tst-iconv_prog.sh
> index 14b7c08c91..2505f0f371 100644
> --- a/iconv/tst-iconv_prog.sh
> +++ b/iconv/tst-iconv_prog.sh
> @@ -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=$?
>  }
>
> --
> 2.31.1
>
Adhemerval Zanella Oct. 21, 2021, 2:17 p.m. UTC | #2
On 20/10/2021 18:22, Stafford Horne via Libc-alpha wrote:
> Ping,
> 

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> And by the way, Am I allowed to push upstream trivial fixes like this
> without review?  I think reviewing should be mandatory, but some
> projects feel different.

I think the current approach is to still send trivial patches upstream
and after some time announce that you intend to push.  The main problem
is sometime is hard to define what is 'trivial' fixes.

> 
> On Tue, Oct 5, 2021 at 10:56 AM Stafford Horne <shorne@gmail.com> wrote:
>>
>> 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.
>> ---
>>  iconv/tst-iconv_prog.sh | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/iconv/tst-iconv_prog.sh b/iconv/tst-iconv_prog.sh
>> index 14b7c08c91..2505f0f371 100644
>> --- a/iconv/tst-iconv_prog.sh
>> +++ b/iconv/tst-iconv_prog.sh
>> @@ -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=$?
>>  }
>>
>> --
>> 2.31.1
>>
diff mbox series

Patch

diff --git a/iconv/tst-iconv_prog.sh b/iconv/tst-iconv_prog.sh
index 14b7c08c91..2505f0f371 100644
--- a/iconv/tst-iconv_prog.sh
+++ b/iconv/tst-iconv_prog.sh
@@ -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=$?
 }