All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 6/6] zram: Increase timeout according to used devices
Date: Tue, 2 Feb 2021 19:25:18 +0800	[thread overview]
Message-ID: <CAEemH2dKrgZLj08LQbtOQse757rEBoUCe2EnBniBaea3HpgdNw@mail.gmail.com> (raw)
In-Reply-To: <YBkBZskAIFpyUGPO@pevik>

Hi Petr,

On Tue, Feb 2, 2021 at 3:38 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li,
>
> > On Sat, Jan 30, 2021 at 4:16 AM Petr Vorel <pvorel@suse.cz> wrote:
>
> > > > Hi,
>
> > > > > +   TST_TIMEOUT=$((dev_num*200))
> > > > Actually on heavy loaded machine this is not enough due BTRFS.
> > > > I can add something like dev_num*600 or even -1 (then previous commit
> > > would not
> > > > be needed, but IMHO still useful).
>
>
> > I personally think -1 is better.
> OK. In that case we might avoid now unneeded previous commit.
>
>
>
> > > And bad thing is that it breaks other zram tests, because the timer
> > > probably
> > > does not allow to run the cleanup:
>
> > > _tst_setup_timer()
> > > {
> > > ...
> > >         sleep $sec && tst_res TBROK "test killed, timeout! If you are
> > > running on slow machine, try exporting LTP_TIMEOUT_MUL > 1" && kill -9
> > > -$pid &
>
> > > I'm not sure if shell allow us to do it better. Maybe sent different
> > > signal than
> > > SIGKILL and define 'trap _tst_do_exit' for that signal?
>
>
> > Sounds practicable. I guess sending SIGINT could make more sense, since
> > sometimes we use CTRL+C stop test in debugging by manual, test should
> > do cleanup work for that behavior too.
> We have already SIGINT defined for main shell process:
> trap "tst_brk TBROK 'test interrupted'" INT
>
> so CTRL+C is covered. So maybe run first SIGINT and then SIGKILL for safety
> reasons?
>

I'm fine with using SIGINT + SIGKILL.

Or, maybe another choice is to catch a signal SIGTERM?  Once we
cancel the specified signal in KILL command, it will try with SIGTERM
by default, if the test process can not be terminated, then a SIGKILL
may be sent.

--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -22,6 +22,7 @@ export TST_LIB_LOADED=1

 # default trap function
 trap "tst_brk TBROK 'test interrupted'" INT
+trap "_tst_do_exit" TERM

 _tst_do_exit()
 {
@@ -459,7 +460,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 terminated, timeout! If you are
running on slow machine, try exporting LTP_TIMEOUT_MUL > 1" && kill --
-$pid &

        _tst_setup_timer_pid=$!


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210202/04007113/attachment.htm>

  reply	other threads:[~2021-02-02 11:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 19:41 [LTP] [PATCH v2 0/6] zram cleanup Petr Vorel
2021-01-29 19:41 ` [LTP] [PATCH v2 1/6] zram: Calculate dev_num variable Petr Vorel
2021-01-29 19:41 ` [LTP] [PATCH v2 2/6] zram01.sh: Generate test setup variables in setup Petr Vorel
2021-01-29 20:17   ` Petr Vorel
2021-01-30  5:37   ` Li Wang
2021-02-02  7:17     ` Petr Vorel
2021-02-02 11:16       ` Li Wang
2021-02-06 19:59         ` Petr Vorel
2021-02-08  7:11           ` Petr Vorel
2021-02-18  9:00             ` Li Wang
2021-03-01 14:34   ` Cyril Hrubis
2021-03-01 16:04     ` Petr Vorel
2021-01-29 19:41 ` [LTP] [PATCH v2 3/6] zram: Move zram_compress_alg() to zram02.sh Petr Vorel
2021-03-01 14:55   ` Cyril Hrubis
2021-03-01 15:35     ` Petr Vorel
2021-01-29 19:41 ` [LTP] [PATCH v2 4/6] zram: Move test specific functions out of zram_lib.sh Petr Vorel
2021-03-01 14:57   ` Cyril Hrubis
2021-01-29 19:41 ` [LTP] [RFC PATCH v2 5/6] tst_test.sh: Run _tst_setup_timer after $TST_SETUP Petr Vorel
2021-01-29 20:17   ` Petr Vorel
2021-03-01 15:06   ` Cyril Hrubis
2021-01-29 19:41 ` [LTP] [PATCH v2 6/6] zram: Increase timeout according to used devices Petr Vorel
2021-01-29 20:10   ` Petr Vorel
2021-01-29 20:15     ` Petr Vorel
2021-01-30  8:26       ` Li Wang
2021-02-02  7:38         ` Petr Vorel
2021-02-02 11:25           ` Li Wang [this message]
2021-03-01 15:14     ` Cyril Hrubis
2021-03-01 15:41       ` Petr Vorel
2021-03-01 15:45         ` Petr Vorel
2021-03-01 15:48         ` Cyril Hrubis
2021-03-01 16:18           ` 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=CAEemH2dKrgZLj08LQbtOQse757rEBoUCe2EnBniBaea3HpgdNw@mail.gmail.com \
    --to=liwang@redhat.com \
    --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.