make SERVICE_TIMEOUT variable

This allows us to set SERVICE_TIMEOUT per job to handle services which
might take longer to stop / start. We'll default to 30 as a reasonably
safe value.

Change-Id: I306a9ddfb957a947915eecc2d3121a15909f54d3
This commit is contained in:
Sean Dague 2015-10-02 08:23:09 -04:00
parent 4721bc70a9
commit a70641034a
2 changed files with 5 additions and 2 deletions

View File

@ -92,6 +92,9 @@ VERIFY_RESOURCES=${VERIFY_RESOURCES:-True}
# Set up for Javelin (default to True)
RUN_JAVELIN=${RUN_JAVELIN:-True}
# How long should we wait for services to start / stop before we
# consider it a fail. Defaults to 30 seconds.
SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-30}
# Local variables:
# mode: shell-script

View File

@ -138,7 +138,7 @@ function is_service_running {
# wait for services to stop, wait up to 10 seconds because sometimes
# services take a while to shutdown.
function ensure_services_stopped {
local wait_for=10
local wait_for=$SERVICE_TIMEOUT
local still_running=""
while [ $wait_for -gt 0 ]; do
still_running=""
@ -168,7 +168,7 @@ function ensure_services_stopped {
# Functions to handle service checking
function ensure_services_started {
local wait_for=10
local wait_for=$SERVICE_TIMEOUT
while [ $wait_for -gt 0 ]; do
not_running=""
local service=""