From: Erwan Velu Date: Wed, 23 Mar 2016 09:22:28 +0000 (+0100) Subject: tests: Moving sleep call after action in ceph_watch_wait() X-Git-Tag: v10.1.1~3^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a49a869011e18ee08cff4f37b28fb0cd05eec10;p=ceph.git tests: Moving sleep call after action in ceph_watch_wait() ceph_watch_wait() is doing a sleep _before_ doing the test which could stop this loop. It's better doing the action first as it could exit immediately and avoid a useless sleep. That's a minor optimization but everything count when trying to get something smooth. Signed-off-by: Erwan Velu --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 0484c3ce21f1..7f933ee35fb0 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -170,8 +170,8 @@ function ceph_watch_wait() fi for i in `seq ${timeout}`; do - sleep 1 grep -q "$regexp" $CEPH_WATCH_FILE && break + sleep 1 done kill $CEPH_WATCH_PID