From ad37518fbe013da46d7641ca7985f32dfd4040f4 Mon Sep 17 00:00:00 2001 From: Vishnu Kannan Date: Sat, 20 Dec 2014 02:02:03 +0000 Subject: [PATCH] Improve monitoring e2e test. --- hack/e2e-suite/monitoring.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/e2e-suite/monitoring.sh b/hack/e2e-suite/monitoring.sh index 244615ca3a..045be5d2b2 100755 --- a/hack/e2e-suite/monitoring.sh +++ b/hack/e2e-suite/monitoring.sh @@ -68,10 +68,12 @@ function cleanup { } function influx-data-exists { + local max_retries=10 + local retry_delay=30 #seconds local influx_ip=$("${KUBECTL}" get -o json pods influx-grafana | grep hostIP | awk '{print $2}' | sed 's/["|,]//g') local influx_url="http://$influx_ip:8086/db/k8s/series?u=root&p=root" - if ! curl -G $influx_url --data-urlencode "q=select * from stats limit 1" \ - || ! curl -G $influx_url --data-urlencode "q=select * from machine limit 1"; then + if ! curl --retry $max_retries --retry-delay $retry_delay -G $influx_url --data-urlencode "q=select * from stats limit 1" \ + || ! curl --retry $max_retries --retry-delay $retry_delay -G $influx_url --data-urlencode "q=select * from machine limit 1"; then echo "failed to retrieve stats from Infludb. monitoring test failed" exit 1 fi