Skip to content

Commit

Permalink
test: lengthen timeouts on controllercharm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aflynn50 committed Oct 15, 2024
1 parent 6dd513e commit e8e29cf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/suites/controllercharm/prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ run_prometheus() {
juju deploy prometheus-k8s --trust
juju relate prometheus-k8s controller.controller
wait_for "prometheus-k8s" "$(active_idle_condition "prometheus-k8s" 0 0)"
retry 'check_prometheus_targets prometheus-k8s 0' 15
retry 'check_prometheus_targets prometheus-k8s 0' 30

juju remove-relation prometheus-k8s controller
# Check Juju controller is removed from Prometheus targets
retry 'check_prometheus_no_target prometheus-k8s 0' 5
retry 'check_prometheus_no_target prometheus-k8s 0' 30
# Check no errors in controller charm or Prometheus
juju status -m controller --format json | jq -r "$(active_condition "controller")" | check "controller"
juju status --format json | jq -r "$(active_condition "prometheus-k8s")" | check "prometheus-k8s"
Expand All @@ -37,16 +37,16 @@ run_prometheus_multiple_units() {
juju deploy prometheus-k8s p1 --trust
juju relate p1 controller.controller
wait_for "p1" "$(active_idle_condition "p1" 0 0)"
retry 'check_prometheus_targets p1 0' 15
retry 'check_prometheus_targets p1 0' 30

juju deploy prometheus-k8s p2 --trust
juju relate p2 controller.controller
wait_for "p2" "$(active_idle_condition "p2" 1 0)"
retry 'check_prometheus_targets p2 0' 15
retry 'check_prometheus_targets p2 0' 30

juju add-unit p1
wait_for "p1" "$(active_idle_condition "p1" 0 1)"
retry 'check_prometheus_targets p1 1' 15
retry 'check_prometheus_targets p1 1' 30

juju remove-unit p1 --num-units 1
# Wait until the application p1 settles before health checks
Expand All @@ -61,24 +61,24 @@ run_prometheus_multiple_units() {
wait_for "p2" "$(active_condition "p2" 1)"

# Check Juju controller is removed from Prometheus targets
retry 'check_prometheus_no_target p2 0' 5
retry 'check_prometheus_no_target p2 0' 30
# Check no errors in controller charm or Prometheus
juju status -m controller --format json | jq -r "$(active_condition "controller")" | check "controller"
juju status --format json | jq -r "$(active_condition "p2" 1)" | check "p2"

juju remove-relation p1 controller

# Check Juju controller is removed from Prometheus targets
retry 'check_prometheus_no_target p1 0' 5
retry 'check_prometheus_no_target p1 0' 30
# Check no errors in controller charm or Prometheus
juju status -m controller --format json | jq -r "$(active_condition "controller")" | check "controller"
# Ensure p1 is still healty
wait_for "p1" "$(active_condition "p1" 0)"

juju remove-application p1 --destroy-storage \
--force --no-wait # TODO: remove these flags once storage bug is fixed
--force --no-wait --no-prompt # TODO: remove these flags once storage bug is fixed
juju remove-application p2 --destroy-storage \
--force --no-wait # TODO: remove these flags once storage bug is fixed
--force --no-wait --no-prompt # TODO: remove these flags once storage bug is fixed
destroy_controller "${MODEL_NAME}"
}

Expand All @@ -102,17 +102,17 @@ run_prometheus_cross_controller() {
juju deploy prometheus-k8s --trust
juju relate prometheus-k8s "${CONTROLLER_NAME}:controller.controller"
wait_for "prometheus-k8s" "$(active_idle_condition "prometheus-k8s" 0 0)"
retry 'check_prometheus_targets prometheus-k8s 0' 15
retry 'check_prometheus_targets prometheus-k8s 0' 30

juju remove-relation prometheus-k8s controller
# Check Juju controller is removed from Prometheus targets
retry 'check_prometheus_no_target prometheus-k8s 0' 5
retry 'check_prometheus_no_target prometheus-k8s 0' 30
# Check no errors in controller charm or Prometheus
juju status -m controller --format json | jq -r "$(active_condition "controller")" | check "controller"
juju status --format json | jq -r "$(active_condition "prometheus-k8s")" | check "prometheus-k8s"

juju remove-application prometheus-k8s --destroy-storage \
--force --no-wait # TODO: remove these flags once storage bug is fixed
--force --no-wait --no-prompt # TODO: remove these flags once storage bug is fixed
destroy_controller "${PROMETHEUS_MODEL_NAME}"
}

Expand Down

0 comments on commit e8e29cf

Please sign in to comment.