From: Mykola Golub Date: Tue, 3 Mar 2015 06:30:29 +0000 (+0200) Subject: test: test_common.sh: stop_osd: wait for osd termination before return X-Git-Tag: v9.0.1~157^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5019eae23f7a57ff8fe5edfbfbf3741b0a3b6d62;p=ceph.git test: test_common.sh: stop_osd: wait for osd termination before return This fixed races in tests when an osd is starting while the previos process is not finished yet. Signed-off-by: Mykola Golub --- diff --git a/src/test/test_common.sh b/src/test/test_common.sh index 33c30ec98424..9535b02d28da 100755 --- a/src/test/test_common.sh +++ b/src/test/test_common.sh @@ -43,7 +43,13 @@ stop_osd() { osd_index=$1 pidfile="out/osd.$osd_index.pid" if [ -e $pidfile ]; then - kill `cat $pidfile` && return 0 + if kill `cat $pidfile` ; then + poll_cmd "eval test -e $pidfile ; echo \$?" "1" 1 30 + [ $? -eq 1 ] && return 0 + echo "ceph-osd process did not terminate correctly" + else + echo "kill `cat $pidfile` failed" + fi else echo "ceph-osd process $osd_index is not running" fi