]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: test_common.sh: stop_osd: wait for osd termination before return
authorMykola Golub <mgolub@mirantis.com>
Tue, 3 Mar 2015 06:30:29 +0000 (08:30 +0200)
committerMykola Golub <mgolub@mirantis.com>
Wed, 25 Mar 2015 07:31:40 +0000 (09:31 +0200)
This fixed races in tests when an osd is starting while the previos
process is not finished yet.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/test/test_common.sh

index 33c30ec98424ce20e85805c79f91792ccf2db308..9535b02d28dabf444e3d65ae486c1359e715b2aa 100755 (executable)
@@ -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