[sheepdog] [PATCH] tests: make _wait_for_sheep run faster

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Jun 21 02:13:52 CEST 2013


At Thu, 20 Jun 2013 15:34:56 +0800,
Liu Yuan wrote:
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  tests/functional/common.rc |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tests/functional/common.rc b/tests/functional/common.rc
> index 1ef9992..3f5a46a 100644
> --- a/tests/functional/common.rc
> +++ b/tests/functional/common.rc
> @@ -195,8 +195,6 @@ _wait_for_sheep()
>          PORT=$((7000 + $2))
>      fi
>      while true; do
> -        sleep 2
> -
>          if [ $(_count_sheep_processes) != $1 ]; then
>              _die "should have $1, but have $(_count_sheep_processes) sheep"
>          fi
> @@ -205,6 +203,7 @@ _wait_for_sheep()
>  
>          if [ $? != 0 ]; then
>              # sheep is not ready yet
> +            sleep 1
>              continue
>          fi

This causes a busy loop while waiting for other nodes to join.  I'd
suggest adding sleep when ${nr_sheep} is less than $1.

Thanks,

Kazutaka



More information about the sheepdog mailing list