[PATCH v7 4/4] tests: check status qualifier
Paul Chaignon
paul.chaignon at gmail.com
Wed Jul 10 12:11:32 UTC 2019
On Wed, Jul 10, 2019 at 03:16:33AM +0300, Dmitry V. Levin wrote:
> On Sat, Jul 06, 2019 at 09:20:15AM +0200, Paul Chaignon wrote:
> [...]
> > diff --git a/tests/status-detached.test b/tests/status-detached.test
> > new file mode 100755
> > index 00000000..8db11163
> > --- /dev/null
> > +++ b/tests/status-detached.test
> > @@ -0,0 +1,17 @@
> > +#!/bin/sh
> > +#
> > +# Check -e status=detached option.
> > +#
> > +# Copyright (c) 2019 Paul Chaignon <paul.chaignon at gmail.com>
> > +# All rights reserved.
> > +#
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +. "${srcdir=.}/init.sh"
> > +
> > +# -I2 avoids blocking all fatal signals, the default when using -o.
> > +$STRACE -o "$LOG" -I2 -e status=detached ../sleep 2 &
> > +pid=$!
> > +../sleep 1
> > +kill $pid
> > +match_grep
>
> There has to be a "wait" between kill and match_grep to avoid the race
> between strace writing its "<detached ...>" output and match_grep checking it.
Ah, thanks a lot! I had this test fail once in Travis CI but was unable
to reproduce locally and the error message showed nothing wrong (probably
because the log file was written between the check and the error message
display).
Paul
More information about the Strace-devel
mailing list