From ff1ffeb8e6fc80836901f0cdd9d24dac783fb659 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 18 Jul 2024 18:25:12 -0400 Subject: [PATCH] Ensure image is published at the end Signed-off-by: Yuri Shkuro --- scripts/hotrod-integration-test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/hotrod-integration-test.sh b/scripts/hotrod-integration-test.sh index 8fc080e9378..3dd641a2621 100755 --- a/scripts/hotrod-integration-test.sh +++ b/scripts/hotrod-integration-test.sh @@ -68,17 +68,23 @@ poll_jaeger() { } # Polling loop +span_count=0 for ((i=1; i<=MAX_RETRIES; i++)); do span_count=$(poll_jaeger "${TRACE_ID}") if [[ "$span_count" -ge "$EXPECTED_SPANS" ]]; then echo "Trace found with $span_count spans." - exit 0 + break fi echo "Retry $i/$MAX_RETRIES: Trace not found or insufficient spans ($span_count/$EXPECTED_SPANS). Retrying in $SLEEP_INTERVAL seconds..." sleep $SLEEP_INTERVAL done -echo "Failed to find the trace with the expected number of spans within the timeout period." -exit 1 +if [[ "$span_count" -lt "$EXPECTED_SPANS" ]]; then + echo "Failed to find the trace with the expected number of spans within the timeout period." + exit 1 +fi + +# Ensure the image is published after succesful test (no -l flag) +bash scripts/build-upload-a-docker-image.sh -c example-hotrod -d examples/hotrod -p "${platforms}"