From 813ff32a563072fa6b5ea634d06013ca6cf63ed4 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 18 Jul 2024 23:36:46 -0300 Subject: [PATCH] Ensure hotrod image is published at the end of e2e test (#5764) --- 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..2cb8d71266a 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 successful test (no -l flag) +bash scripts/build-upload-a-docker-image.sh -c example-hotrod -d examples/hotrod -p "${platforms}"