]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Moving sleep call after action in ceph_watch_wait()
authorErwan Velu <erwan@redhat.com>
Wed, 23 Mar 2016 09:22:28 +0000 (10:22 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
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 <erwan@redhat.com>
qa/workunits/cephtool/test.sh

index 0484c3ce21f1c36959c267bccbca37907da8e04d..7f933ee35fb01210bbea4a062ce64bc6419311c1 100755 (executable)
@@ -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