FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH] generic/019: kill background processes on interrupt
Date: Mon, 18 Apr 2022 10:07:37 -0700	[thread overview]
Message-ID: <20220418170737.GE17014@magnolia> (raw)
In-Reply-To: <CAOQ4uxg8G1AkcyzpALy8Nc7duuENCYatLOqY9vF6PL5maM4NWg@mail.gmail.com>

On Sat, Apr 16, 2022 at 08:13:59PM +0300, Amir Goldstein wrote:
> On Sat, Apr 16, 2022 at 5:11 PM Zorro Lang <zlang@redhat.com> wrote:
> >
> > On Sat, Apr 16, 2022 at 12:20:22PM +0300, Amir Goldstein wrote:
> > > On Fri, Apr 15, 2022 at 12:56 PM Zorro Lang <zlang@redhat.com> wrote:
> > > >
> > > > On Fri, Apr 15, 2022 at 12:25:44AM +0800, Zorro Lang wrote:
> > > > > On Wed, Apr 13, 2022 at 10:26:56AM +1000, Dave Chinner wrote:
> > > > > > On Tue, Apr 12, 2022 at 10:25:00PM +0800, Zorro Lang wrote:
> > > > > > > On Tue, Apr 12, 2022 at 02:59:42PM +0200, David Disseldorp wrote:
> > > > > > > > On Mon, 11 Apr 2022 15:48:33 +1000, Dave Chinner wrote:
> > > > > > > >
> > > > > > > > > From: Dave Chinner <dchinner@redhat.com>
> > > > > > > > >
> > > > > > > > > If you ctrl-c generic/019, it leaves fsstress processes running.
> > > > > > > > > Kill them in the cleanup function so that they don't have to be
> > > > > > > > > manually killed after interrupting the test.
> > > > > > > > >
> > > > > > > > > While touching the _cleanup() function, make it do everything that
> > > > > > > > > the generic _cleanup function it overrides does and fix the
> > > > > > > > > indenting.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > > > > > > > > ---
> > > > > > > > >  tests/generic/019 | 6 ++++--
> > > > > > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > > > > > >
> > > > > > > > > diff --git a/tests/generic/019 b/tests/generic/019
> > > > > > > > > index db56dac1..cda107f4 100755
> > > > > > > > > --- a/tests/generic/019
> > > > > > > > > +++ b/tests/generic/019
> > > > > > > > > @@ -53,8 +53,10 @@ stop_fail_scratch_dev()
> > > > > > > > >  # Override the default cleanup function.
> > > > > > > > >  _cleanup()
> > > > > > > > >  {
> > > > > > > > > -    disallow_fail_make_request
> > > > > > > > > -    rm -f $tmp.*
> > > > > > > > > +     kill $fs_pid $fio_pid &> /dev/null
> > > > > > > > > +     disallow_fail_make_request
> > > > > > > > > +     cd /
> > > > > > > > > +     rm -r -f $tmp.*
> > > > > > > > >  }
> > > > > > > > >
> > > > > > > > >  RUN_TIME=$((20+10*$TIME_FACTOR))
> > > > > > > >
> > > > > > > > Might be worth unset'ing the "fs_pid" and "fio_pid" variables after the
> > > > > > > > wait, but should be fine as-is:
> > > > > > >
> > > > > > > I agree. Better to avoid killing other system processes. Or how about this place
> > > > > > > does (avoid killing system useful processes):
> > > > > > > $KILLALL_PROG -q $FSSTRESS_PROG
> > > > > > > $KILLALL_PROG -q $FIO_PROG
> > > > > > >
> > > > > > > Another picky question is, do we need to use a while loop checking, until the
> > > > > > > processes really get killed? :)
> > > > > >
> > > > > > Do we really need to paint the bikeshed over how best to kill a
> > > > > > process? I don't have time to do that, this is just a drive-by fix
> > > > > > that works for me....
> > > > >
> > > > > Sure Dave:) The while loop checking is a little picky, I just ask what do you think, no
> > > > > objection if you don't like that. Due to quick cleanup and exit is a good reason too.
> > > > >
> > > > > I think it might be worth doing "$KILLALL_PROG -q $FSSTRESS_PROG $FIO_PROG" at least, to
> > > > > avoid killing other processes might be useful.
> > >
> > > That has much more likelihood to kill processes not spawn by the test
> > > then pid wraparound.
> >
> > Yes, you're right. But generally we don't run xfstests with other testing, to avoid other
> > testing break dmesg checking of xfstests. (Is there a way to help different process get
> > independent dmesg out? If there's, I'm very glad to know how to do that, then I can run
> > xfstests concurrently in one system:)
> >
> > Anyway, we can choose another way -- "unset'ing the "fs_pid" and "fio_pid" variables
> > after the wait", both are fine to me.
> >
> 
> Fine by me

The change to clear the fs_pid/fio_pid variables was not correct and now
causes generic/019 to fail.  I'll send a patch shortly.

--D

> Thanks,
> Amir.

  reply	other threads:[~2022-04-18 17:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  5:48 [PATCH] generic/019: kill background processes on interrupt Dave Chinner
2022-04-12 12:59 ` David Disseldorp
2022-04-12 14:25   ` Zorro Lang
2022-04-13  0:26     ` Dave Chinner
2022-04-13  7:13       ` Amir Goldstein
2022-04-13 23:27         ` Darrick J. Wong
2022-04-18  0:02         ` Dave Chinner
2022-04-14 16:25       ` Zorro Lang
2022-04-14 19:16         ` Zorro Lang
2022-04-16  9:20           ` Amir Goldstein
2022-04-16 14:11             ` Zorro Lang
2022-04-16 17:13               ` Amir Goldstein
2022-04-18 17:07                 ` Darrick J. Wong [this message]
2022-04-18 18:08                   ` Zorro Lang

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=20220418170737.GE17014@magnolia \
    --to=djwong@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    /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