From: Kefu Chai Date: Tue, 1 Mar 2016 09:40:04 +0000 (+0800) Subject: qa/workunits/cephtool/test.sh: wait longer in ceph_watch_start() X-Git-Tag: v10.1.0~213^2~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6eff39af7995788f9aae03167468d9bf7239604b;p=ceph.git qa/workunits/cephtool/test.sh: wait longer in ceph_watch_start() "ceph --watch-debug" and "ceph tell mon.foo version" could connect to different monitors, and there is chance that "ceph --watch-debug" is not connected yet when "ceph tell" completes, and hence the former fails to collect the cluster log including the "ceph tell" related message. this renders test_mon_tell() unreliable. so, in ceph_watch_start(), we should wait until the "ceph" cli connects to the monitor and receives messages from it. Fixes: #14910 Signed-off-by: Kefu Chai --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index de2c46773cbe..08a401480f00 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -151,6 +151,13 @@ function ceph_watch_start() CEPH_WATCH_FILE=${TMPDIR}/CEPH_WATCH_$$ ceph $whatch_opt > $CEPH_WATCH_FILE & CEPH_WATCH_PID=$! + + # wait until the "ceph" client is connected and receiving + # log messages from monitor + for i in `seq 3`; do + grep -q "cluster" $CEPH_WATCH_FILE && break + sleep 1 + done } function ceph_watch_wait()