From 5019eae23f7a57ff8fe5edfbfbf3741b0a3b6d62 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Tue, 3 Mar 2015 08:30:29 +0200 Subject: [PATCH] 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 --- src/test/test_common.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.47.3