speed up envoy integ tests by not politely stopping containers before destroying them (#8969)

In local testing this sped up the stop_services call from 11s to 1s per test.
This commit is contained in:
R.B. Boyer 2020-10-15 11:51:37 -05:00 committed by GitHub
parent 40c16f6ee4
commit a68c0ce1e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -72,7 +72,8 @@ function start_consul {
local DC=${1:-primary} local DC=${1:-primary}
# Start consul now as setup script needs it up # Start consul now as setup script needs it up
docker-compose rm -s -v -f consul-${DC} || true docker-compose kill consul-${DC} || true
docker-compose rm -v -f consul-${DC} || true
docker-compose up -d consul-${DC} docker-compose up -d consul-${DC}
} }
@ -95,7 +96,8 @@ function start_services {
# Start containers required # Start containers required
if [ ! -z "$REQUIRED_SERVICES" ] ; then if [ ! -z "$REQUIRED_SERVICES" ] ; then
docker-compose rm -s -v -f $REQUIRED_SERVICES || true docker-compose kill $REQUIRED_SERVICES || true
docker-compose rm -v -f $REQUIRED_SERVICES || true
docker-compose up --build -d $REQUIRED_SERVICES docker-compose up --build -d $REQUIRED_SERVICES
fi fi
@ -112,7 +114,8 @@ function verify {
res=0 res=0
# Nuke any previous case's verify container. # Nuke any previous case's verify container.
docker-compose rm -s -v -f verify-${DC} || true docker-compose kill verify-${DC} || true
docker-compose rm -v -f verify-${DC} || true
if docker-compose up --abort-on-container-exit --exit-code-from verify-${DC} verify-${DC} ; then if docker-compose up --abort-on-container-exit --exit-code-from verify-${DC} verify-${DC} ; then
echogreen "✓ PASS" echogreen "✓ PASS"
@ -156,7 +159,8 @@ function stop_services {
if [ -f "${CASE_DIR}/teardown.sh" ] ; then if [ -f "${CASE_DIR}/teardown.sh" ] ; then
source "${CASE_DIR}/teardown.sh" source "${CASE_DIR}/teardown.sh"
fi fi
docker-compose rm -s -v -f $REQUIRED_SERVICES || true docker-compose kill $REQUIRED_SERVICES || true
docker-compose rm -v -f $REQUIRED_SERVICES || true
} }
function init_vars { function init_vars {