[CRIU] [PATCH 2/2] zdtm: wait a test process instead of output file
Andrew Vagin
avagin at parallels.com
Thu Jul 4 04:30:12 EDT 2013
On Thu, Jul 04, 2013 at 03:26:49PM +0400, Pavel Emelyanov wrote:
> On 07/04/2013 03:21 PM, Andrey Vagin wrote:
> > A test should be completed if a test process exited.
> >
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> > test/zdtm.sh | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/test/zdtm.sh b/test/zdtm.sh
> > index f28d33a..530379a 100755
> > --- a/test/zdtm.sh
> > +++ b/test/zdtm.sh
> > @@ -425,10 +425,14 @@ EOF
> > done
> >
> > echo Check results $PID
> > - stop_test $tdir $tname
> > + stop_test $tdir $tname || {
> > + echo "Unable to stop $tname ($PID)"
> > + return 2
> > + }
> > +
> > sltime=1
> > for i in `seq 50`; do
> > - test -f $test.out && break
> > + kill -0 $PID || break
>
> How about "pid reuse" thing?
It's really a small chance and if someone else creates many processes,
out tests will fail anyway.
Currently if a test crashes, we are waiting about one minutes before fail.
This patch fix this problem.
>
> > echo Waiting...
> > sleep 0.$sltime
> > [ $sltime -lt 9 ] && sltime=$((sltime+1))
> >
>
>
More information about the CRIU
mailing list