public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 3/4] lib: ignore SIGINT in _tst_kill_test
Date: Fri, 14 May 2021 17:10:18 +0200	[thread overview]
Message-ID: <YJ6S2lNjP+G8x0ax@pevik> (raw)
In-Reply-To: <CAEemH2dOg0JN6XrptGZ6WN3C1SOYpWKgSTdXtpcjSZzBjsnOMQ@mail.gmail.com>

Hi Li, Joerg, Cyril,

> Petr Vorel <pvorel@suse.cz> wrote:

> > > Does this below (rough solution in my mind) work for you?
> > LGTM, but Joerg, Metan, could you please have a look?

> Thanks, I wouldn't send a patch until Joerg/Cyril has a review.
> (Maybe Joerg will have another better solution:)
Understand.

> > > diff --git a/lib/newlib_tests/shell/timeout03.sh
> > > b/lib/newlib_tests/shell/timeout03.sh
> > > index cd548d9a2..f39f5712a 100755
> > > --- a/lib/newlib_tests/shell/timeout03.sh
> > > +++ b/lib/newlib_tests/shell/timeout03.sh
> > > @@ -30,6 +30,7 @@ TST_TIMEOUT=1

> > >  do_test()
> > >  {
> > > +       trap "echo 'Sorry, timeout03 is still alive'" TERM
> > Any reason why not use tst_res TINFO? (working on bash).

> +1
> I just use echo for a quick test, but surely we can replace it with tst_res.
+1


> > > -       while kill -0 $pid 2>&1 > /dev/null && [ $i -gt 0 ]; do
> > > +       while kill -0 $pid &>/dev/null && [ $i -gt 0 ]; do
> > FYI: &> is a bashism (we need to keep the original).

> I just want the error does not to redirect to standard output.
> Because with SIGTERM sending, it seems easier to kill all
> processes, so 'kill -0 $pid' returns "No such process" errors often.

> Mayby I should go with: kill -0 $pid >/dev/null 2>&1
+1. Now I see it, "2>&1 > /dev/null" is wrong, it must be vice versa.

Kind regards,
Petr

> e.g.

> # ./timeout04.sh
> timeout04 1 TINFO: timeout per run is 0h 0m 1s
> timeout04 1 TINFO: Start
> timeout04 1 TBROK: Test timeouted, sending SIGTERM! If you are running
> on slow machine, try exporting LTP_TIMEOUT_MUL > 1
> Terminated
> ./../../../testcases/lib/tst_test.sh: line 448: kill: (74911) - No such process
> ./../../../testcases/lib/tst_test.sh: line 454: kill: (74911) - No such process

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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  5:51 [LTP] [PATCH v3 3/4] lib: ignore SIGINT in _tst_kill_test Li Wang
2021-05-10 11:47 ` Cyril Hrubis
2021-05-11  5:54 ` Joerg Vehlow
2021-05-12  9:49   ` Li Wang
2021-05-12 10:34     ` Joerg Vehlow
2021-05-12 14:20     ` Petr Vorel
2021-05-13  5:08       ` Li Wang
2021-05-14  7:53         ` Petr Vorel
2021-05-14  9:10           ` Li Wang
2021-05-14 15:10             ` Petr Vorel [this message]
2021-05-18  4:57         ` Joerg Vehlow
2021-05-18  7:27           ` Li Wang
2021-05-18  8:46             ` Petr Vorel
2021-05-18  9:45             ` Joerg Vehlow
2021-05-18 12:01               ` Li Wang

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=YJ6S2lNjP+G8x0ax@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox