Skip to content

Commit

Permalink
Merge pull request #14434 from wallyworld/ck-test-kill
Browse files Browse the repository at this point in the history
Kill controller at end of ck test
  • Loading branch information
wallyworld committed Aug 8, 2022
2 parents b2d5fae + 9431f99 commit 5f82824
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion tests/includes/juju.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ destroy_controller() {
output="${TEST_DIR}/${name}-destroy-controller.log"

echo "====> Destroying juju ($(green "${name}"))"
echo "${name}" | xargs -I % juju destroy-controller --destroy-all-models -y % >"${output}" 2>&1
if [[ ${KILL_CONTROLLER:-} != "true" ]]; then
echo "${name}" | xargs -I % juju destroy-controller --destroy-all-models -y % >"${output}" 2>&1
else
echo "${name}" | xargs -I % juju kill-controller -t 0 -y % >"${output}" 2>&1
fi

set +e
CHK=$(cat "${output}" | grep -i "ERROR" || true)
Expand Down
6 changes: 2 additions & 4 deletions tests/suites/ck/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ test_ck() {

test_deploy_ck

if [[ ${BOOTSTRAP_REUSE:-} != "true" ]]; then
# CK takes too long to tear down (1h+), so forcibly destroy it
juju kill-controller -y -t 0 "${BOOTSTRAPPED_JUJU_CTRL_NAME}" || true
fi
# CK takes too long to tear down (1h+), so forcibly destroy it
export KILL_CONTROLLER=true
}

0 comments on commit 5f82824

Please sign in to comment.