From c749f6247075274954f8302dd45feee984d9bd10 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 29 Aug 2019 09:46:50 +0200 Subject: [PATCH] HDDS-2045. Partially started compose cluster left running Closes #1358 --- hadoop-ozone/dist/src/main/compose/testlib.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/dist/src/main/compose/testlib.sh b/hadoop-ozone/dist/src/main/compose/testlib.sh index ffc6da2c05d..9aa7c483ccf 100755 --- a/hadoop-ozone/dist/src/main/compose/testlib.sh +++ b/hadoop-ozone/dist/src/main/compose/testlib.sh @@ -82,9 +82,14 @@ start_docker_env(){ local -i datanode_count=${1:-3} docker-compose -f "$COMPOSE_FILE" down - docker-compose -f "$COMPOSE_FILE" up -d --scale datanode="${datanode_count}" - wait_for_datanodes "$COMPOSE_FILE" "${datanode_count}" - sleep 10 + docker-compose -f "$COMPOSE_FILE" up -d --scale datanode="${datanode_count}" \ + && wait_for_datanodes "$COMPOSE_FILE" "${datanode_count}" \ + && sleep 10 + + if [[ $? -gt 0 ]]; then + docker-compose -f "$COMPOSE_FILE" down + return 1 + fi } ## @description Execute robot tests in a specific container.