On 02/10/2015 01:49 AM, Richard Hansen wrote:
> Add a 15-second timeout timer that aborts the test if rcli takes too
> long (or fails) to start.
> ---
>  tests/subsystem/runSubsystemTest.sh.in | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/subsystem/runSubsystemTest.sh.in 
> b/tests/subsystem/runSubsystemTest.sh.in
> index 46f9669..0ef3d48 100644
> --- a/tests/subsystem/runSubsystemTest.sh.in
> +++ b/tests/subsystem/runSubsystemTest.sh.in
> @@ -56,8 +56,12 @@ trap 'kill_loader' EXIT
>  # start loader
>  run_bg "rcli-w" rcli -w -p
>  LOADER_PID=$!
> +
> +timeout=15
>  while ! nc -z localhost `config_get RPKIPort`; do
>      sleep 1
> +    timeout=$((timeout-1))
> +    [ "${timeout}" -gt 0 ] || fatal "timed out waiting for rcli to start"

There's not much point in sleeping for a second just to call fatal
regardless of the status of the loader. I'd move the timeout check above
the sleep.

>  done
>  echo "Loader started (pid = $LOADER_PID)..."
>  
> 


-- 
David Eric Mandelberg / dseomn
http://david.mandelberg.org/

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
rpstir-devel mailing list
rpstir-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpstir-devel

Reply via email to