From 7dac5b011cf5f91d05e8e5caae61660c996774ac Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Fri, 27 Nov 2015 01:56:59 +0200 Subject: [PATCH] pnd_run.sh: improve wait for app exit it used to wait for pidof $EXENAME, which is not great as it's often run.sh, meaning that if you have one running, others will never exit. --- testdata/scripts/pnd_run.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index 2244ef3..0ea23e8 100755 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -101,13 +101,9 @@ PND_WaitFor() { } PND_WaitForExit() { - local l_sleep=1 - PID=$(pidof -o %PPID -x "$1") # get pid of app - while [ -n "$PID" ]; do - sleep $l_sleep - test $l_sleep -lt 10 && l_sleep=$(($l_sleep + 1)) - PID=$(pidof -o %PPID -x "$1") - done + # this used to wait for $1 ($EXENAME), but that doesn't work well + # when multiple PNDs run as too many PNDs have run.sh as $EXENAME + wait } PND_Exec() { -- 2.39.2