1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

tests: update for faster dmeventd

We can drop sleep 6, since dmeventd will quit immediatelly
when no running dmeventd can be restarted.

Also restart itself check more conditions.
This commit is contained in:
Zdenek Kabelac 2024-04-09 23:29:15 +02:00
parent 6382d141fa
commit 8a2839c867

View File

@ -16,17 +16,26 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
_restart_dmeventd() {
local pid=
#rm -f debug.log*
dmeventd -R -fldddd -e "$PWD/test_nologin" > debug.log_DMEVENTD_$RANDOM 2>&1 &
echo $! >LOCAL_DMEVENTD
for i in $(seq 1 10); do
test "$(pgrep -o dmeventd)" = "$(< LOCAL_DMEVENTD)" && break
sleep .1
for i in {1..10}; do
pid=$(pgrep -o dmeventd || true)
test -n "$pid" || break; # no dmeventd running
test "$pid" = "$(< LOCAL_DMEVENTD)" && break
sleep .2
done
# wait a bit, so we talk to the new dmeventd later
dmeventd -i || true
if test -n "$pid" ; then
for i in {1..10}; do
dmeventd -i && break;
sleep .1
done
fi
}
aux prepare_dmeventd
@ -57,8 +66,6 @@ rm LOCAL_DMEVENTD debug.log*
_restart_dmeventd
# wait longer as tries 5s to communicate with killed daemon
sleep 6
# now dmeventd should not be running
not pgrep dmeventd
rm LOCAL_DMEVENTD