All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/1] tst_test.sh: Run cleanup also on timeout
Date: Tue, 2 Feb 2021 11:15:30 +0100	[thread overview]
Message-ID: <YBkmQl1lFmxbdpcb@pevik> (raw)
In-Reply-To: <47060cdf-58a3-2568-3508-31436b9c6e12@jv-coder.de>

Hi J?rg,

> Hi,

> On 2/2/2021 8:47 AM, Petr Vorel wrote:
> > Also timeout requires to run a test cleanup (e.g. zram01.sh).
> > Thus send first SIGINT, but keep also SIGKILL for safety reasons
> > (after 5 sec to give cleanup function some time.
> +1
> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index 69f007d89..35ad6d2d7 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -21,7 +21,7 @@ export TST_LIB_LOADED=1
> >   . tst_security.sh
> >   # default trap function
> > -trap "tst_brk TBROK 'test interrupted'" INT
> > +trap "tst_brk TBROK 'test interrupted or timeout'" INT
> should be "timed out" for consistency
You probably mean consistency with TST_RETRY_FN_EXP_BACKOFF()
I tried to be consistent with previous message:
zram01 1 TBROK: test killed, timeout! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1
That one should be changed as well.
I slightly prefer "timeout", but I'm not a native speaker.

> >   _tst_do_exit()
> >   {
> > @@ -459,7 +459,7 @@ _tst_setup_timer()
> >   	tst_res TINFO "timeout per run is ${h}h ${m}m ${s}s"
> > -	sleep $sec && tst_res TBROK "test killed, timeout! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1" && kill -9 -$pid &
> > +	sleep $sec && tst_res TBROK "test killed, timeout! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1" && { kill -2 -$pid; sleep 5; kill -9 -$pid; } &
> Can we move the timeout handling to a separate function? This is getting a
> tiny bit unreadable...
> Can this work?:
> _tst_handle_timeout()
> {
> ??? tst_res TBROK ...
> ??? kill ....
> }
> ...
> sleep $sec && _tst_handle_timeout &
+1.

Thanks!

Kind regards,
Petr

> J?rg

  reply	other threads:[~2021-02-02 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  7:47 [LTP] [RFC PATCH 1/1] tst_test.sh: Run cleanup also on timeout Petr Vorel
2021-02-02  8:19 ` Joerg Vehlow
2021-02-02 10:15   ` Petr Vorel [this message]
2021-02-02 12:04     ` Joerg Vehlow

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=YBkmQl1lFmxbdpcb@pevik \
    --to=pvorel@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.