Use LTP_TIMEOUT_MUL in TST_RETRY_FN()
diff mbox series

Message ID 20190911085536.25546-1-cfamullaconrad@suse.de
State Changes Requested
Delegated to: Petr Vorel
Headers show
Series
  • Use LTP_TIMEOUT_MUL in TST_RETRY_FN()
Related show

Commit Message

Clemens Famulla-Conrad Sept. 11, 2019, 8:55 a.m. UTC
We discovered timeout problems for well known candidates.
Most of the time we already use LTP_TIMEOUT_MUL in other cases to
globally increase timeout value. So doing it for this function as well.

Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
---
 testcases/lib/tst_test.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Petr Vorel Sept. 11, 2019, 9:12 a.m. UTC | #1
Hi Clemens,

> We discovered timeout problems for well known candidates.
> Most of the time we already use LTP_TIMEOUT_MUL in other cases to
> globally increase timeout value. So doing it for this function as well.

> Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
> ---
>  testcases/lib/tst_test.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index e0b24c6b9..80b8871cb 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -162,9 +162,11 @@ EXPECT_FAIL()

>  TST_RETRY_FN_EXP_BACKOFF()
>  {
> +	LTP_TIMEOUT_MUL=${LTP_TIMEOUT_MUL:-1}
> +
>  	local tst_fun="$1"
>  	local tst_exp=$2
> -	local tst_sec=$(expr $3 \* 1000000)
> +	local tst_sec=$(expr $3 \* 1000000 \* $LTP_TIMEOUT_MUL)
>  	local tst_delay=1

I'm for it, but that will diverge from C API. Shouldn't we add it also
to tst_common.h?

Kind regards,
Petr
Clemens Famulla-Conrad Sept. 11, 2019, 9:17 a.m. UTC | #2
On Wed, 2019-09-11 at 11:12 +0200, Petr Vorel wrote:
> Hi Clemens,
> 
> > We discovered timeout problems for well known candidates.
> > Most of the time we already use LTP_TIMEOUT_MUL in other cases to
> > globally increase timeout value. So doing it for this function as
> > well.
> > Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
> > ---
> >  testcases/lib/tst_test.sh | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index e0b24c6b9..80b8871cb 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -162,9 +162,11 @@ EXPECT_FAIL()
> >  TST_RETRY_FN_EXP_BACKOFF()
> >  {
> > +	LTP_TIMEOUT_MUL=${LTP_TIMEOUT_MUL:-1}
> > +
> >  	local tst_fun="$1"
> >  	local tst_exp=$2
> > -	local tst_sec=$(expr $3 \* 1000000)
> > +	local tst_sec=$(expr $3 \* 1000000 \* $LTP_TIMEOUT_MUL)
> >  	local tst_delay=1
> 
> I'm for it, but that will diverge from C API. Shouldn't we add it
> also
> to tst_common.h?

Agree, let me add it. Thx for the hint.

> 
> Kind regards,
> Petr

Patch
diff mbox series

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index e0b24c6b9..80b8871cb 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -162,9 +162,11 @@  EXPECT_FAIL()
 
 TST_RETRY_FN_EXP_BACKOFF()
 {
+	LTP_TIMEOUT_MUL=${LTP_TIMEOUT_MUL:-1}
+
 	local tst_fun="$1"
 	local tst_exp=$2
-	local tst_sec=$(expr $3 \* 1000000)
+	local tst_sec=$(expr $3 \* 1000000 \* $LTP_TIMEOUT_MUL)
 	local tst_delay=1
 
 	if [ $# -ne 3 ]; then