2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

zdtm: wait a test process instead of output file

zdtm.sh reports error immediatly, if a test process exited or crashed.

We should be fear, that pid can be reused. There are many place, which
will fail in this case. And a chance to get this situation is really small.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-07-11 15:31:22 +04:00 committed by Pavel Emelyanov
parent 535115eecd
commit a66a06c7f0

View File

@ -426,10 +426,14 @@ EOF
done done
echo Check results $PID echo Check results $PID
stop_test $tdir $tname stop_test $tdir $tname || {
echo "Unable to stop $tname ($PID)"
return 2
}
sltime=1 sltime=1
for i in `seq 50`; do for i in `seq 50`; do
test -f $test.out && break kill -0 $PID > /dev/null 2>&1 || break;
echo Waiting... echo Waiting...
sleep 0.$sltime sleep 0.$sltime
[ $sltime -lt 9 ] && sltime=$((sltime+1)) [ $sltime -lt 9 ] && sltime=$((sltime+1))