mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: avoid sleep on kill path
Before sleeping, check if pid is still there.
This commit is contained in:
parent
a7d7471906
commit
7166bbd9c2
@ -466,12 +466,10 @@ kill_sleep_kill_() {
|
|||||||
pid=$(< "$pidfile")
|
pid=$(< "$pidfile")
|
||||||
rm -f "$pidfile"
|
rm -f "$pidfile"
|
||||||
kill -TERM "$pid" 2>/dev/null || return 0
|
kill -TERM "$pid" 2>/dev/null || return 0
|
||||||
if test "$slow" -eq 0 ; then sleep .1 ; else sleep 1 ; fi
|
for i in {0..10} ; do
|
||||||
kill -KILL "$pid" 2>/dev/null || true
|
ps "$pid" >/dev/null || return 0
|
||||||
local wait=0
|
if test "$slow" -eq 0 ; then sleep .2 ; else sleep 1 ; fi
|
||||||
while ps "$pid" > /dev/null && test "$wait" -le 10; do
|
kill -KILL "$pid" 2>/dev/null || true
|
||||||
sleep .5
|
|
||||||
wait=$(( wait + 1 ))
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user