public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/3] tst_test.sh: Use LTP_TIMEOUT_MUL in TST_RETRY_FN()
Date: Thu, 12 Sep 2019 18:49:23 +0200	[thread overview]
Message-ID: <1568306963.3621.34.camel@suse.de> (raw)
In-Reply-To: <20190912145539.GC22246@dell5510>

On Thu, 2019-09-12 at 16:55 +0200, Petr Vorel wrote:
> Hi Clemens,
> 
> > On Thu, 2019-09-12 at 13:42 +0800, Li Wang wrote:
> > > On Thu, Sep 12, 2019 at 12:52 AM Clemens Famulla-Conrad <
> > > cfamullaconrad@suse.de> wrote:
> > > > Because of timeout problems when using TST_RETRY_FN() we do now
> > > > use
> > > > LTP_TIMEOUT_MUL to adopt the timeout value.
> > > > Introduced tst_adjut_timeout function to have a generic place
> > > > to
> > > > adopt timeout values.
> 
> 
> > > What about using tst_multipy_timeout as the function name? Since
> > > it
> > > only
> > > raises the timeout value with a multiplier.
> 
> +1.
> 
> > I had a this patchset [1] in my mind. 
> > Maybe we will also apply a minimum. But we would still just
> > multiply :)
> > so Sure we can name it tst_multiply_timeout().
> > [1]https://patchwork.ozlabs.org/patch/1155460
> 
> 
> 
> > > > Signed-off-by: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
> > > > ---
> > > >  testcases/lib/tst_test.sh | 12 ++++++++----
> > > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > > > diff --git a/testcases/lib/tst_test.sh
> > > > b/testcases/lib/tst_test.sh
> > > > index e0b24c6b9..03692e503 100644
> > > > --- a/testcases/lib/tst_test.sh
> > > > +++ b/testcases/lib/tst_test.sh
> > > > @@ -164,7 +164,7 @@ TST_RETRY_FN_EXP_BACKOFF()
> > > >  {
> > > >         local tst_fun="$1"
> > > >         local tst_exp=$2
> > > > -       local tst_sec=$(expr $3 \* 1000000)
> > > > +       local tst_sec=$(tst_adjust_timeout $(expr $3 \*
> > > > 1000000))
> > > >         local tst_delay=1
> > > >         if [ $# -ne 3 ]; then
> > > > @@ -371,12 +371,16 @@ _tst_rescmp()
> > > >         fi
> > > >  }
> > > > -
> > > > -_tst_setup_timer()
> > > > +tst_adjust_timeout()
> > > >  {
> > > >         LTP_TIMEOUT_MUL=${LTP_TIMEOUT_MUL:-1}
> > > > +       local timeout=$1
> > > > +       echo $(( timeout * LTP_TIMEOUT_MUL))
> > > Shouldn't we check the LTP_TIMEOUT_MUL > 1 before using it?
> 
> Also timeout should be checked.
> I'd tst_brk TBROK if either of them is < 0.
> 
> > Yes, thx for the hint.
> 
> BTW: I haven't finish patchset doing the same [1]. Feel free to
> include docs
> from [2].

Thx for that hint, was aware of that patchset [1].

> I'll also sent tonight LTP_TIMEOUT_MUL_MIN (as part of v2 for [3]).
> But it should be trivial to rebase changes of the later commit
> (whoever gets merged first).
> 
> 
> Kind regards,
> Petr
> 
> [1] https://patchwork.ozlabs.org/project/ltp/list/?series=120151&stat
> e=*
> [2] https://patchwork.ozlabs.org/patch/1133627/
> [3] https://patchwork.ozlabs.org/patch/1155460/


  reply	other threads:[~2019-09-12 16:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  8:55 [LTP] [PATCH] Use LTP_TIMEOUT_MUL in TST_RETRY_FN() Clemens Famulla-Conrad
2019-09-11  9:12 ` Petr Vorel
2019-09-11  9:17   ` Clemens Famulla-Conrad
2019-09-11 16:52 ` [LTP] [PATCH v2 1/3] tst_test.sh: " Clemens Famulla-Conrad
2019-09-11 16:52   ` [LTP] [PATCH v2 2/3] tst_test.c: Add tst_adjust_timeout() Clemens Famulla-Conrad
2019-09-11 16:52   ` [LTP] [PATCH v2 3/3] tst_common.h: Use tst_adjust_timeout in TST_RETRY_FN() Clemens Famulla-Conrad
2019-09-12  5:42   ` [LTP] [PATCH v2 1/3] tst_test.sh: Use LTP_TIMEOUT_MUL " Li Wang
2019-09-12  8:52     ` Clemens Famulla-Conrad
2019-09-12 14:55       ` Petr Vorel
2019-09-12 16:49         ` Clemens Famulla-Conrad [this message]
2019-09-12 19:46           ` Clemens Famulla-Conrad
2019-09-12 21:51   ` Petr Vorel
2019-10-11 12:02   ` Petr Vorel
2019-10-11 12:53     ` Cyril Hrubis
2019-10-12  2:46       ` Li Wang
2019-10-16 11:25         ` Clemens Famulla-Conrad
2019-10-16 16:15           ` [LTP] [PATCH v3 1/4] " Clemens Famulla-Conrad
2019-10-16 16:15             ` [LTP] [PATCH v3 2/4] tst_test.c: Add tst_multiply_timeout() Clemens Famulla-Conrad
2019-10-17  8:47               ` Petr Vorel
2019-10-16 16:15             ` [LTP] [PATCH v3 3/4] tst_common.h: Use tst_multiply_timeout in TST_RETRY_FN() Clemens Famulla-Conrad
2019-10-17  8:48               ` Petr Vorel
2019-10-16 16:15             ` [LTP] [PATCH v3 4/4] Add newlib shell test for tst_multiply_timeout() Clemens Famulla-Conrad
2019-10-17  9:00               ` Petr Vorel
2019-10-17  8:39             ` [LTP] [PATCH v3 1/4] tst_test.sh: Use LTP_TIMEOUT_MUL in TST_RETRY_FN() Petr Vorel
2019-10-17 12:23               ` Clemens Famulla-Conrad
2019-10-18  7:46                 ` Petr Vorel
2019-10-18  8:29                 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1568306963.3621.34.camel@suse.de \
    --to=cfamullaconrad@suse.de \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox