diff --git a/exercises/euca.sh b/exercises/euca.sh index 7f4869573f..86cd67321e 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -95,5 +95,11 @@ fi # Terminate instance euca-terminate-instances $INSTANCE +# Assure it has terminated within a reasonable time +if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then + echo "server didn't terminate within $TERMINATE_TIMEOUT seconds" + exit 1 +fi + # Delete group euca-delete-group $SECGROUP diff --git a/openrc b/openrc index df011a32ab..d742ced4ab 100644 --- a/openrc +++ b/openrc @@ -89,3 +89,6 @@ export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))} # Max time to wait for proper IP association and dis-association. export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15} + +# Max time to wait for a vm to terminate +export TERMINATE_TIMEOUT=${TERMINATE_TIMEOUT:-30}