Skip to content

Commit fdd77d1

Browse files
committed
Fix basic smoke test failing too early
When the returned SHA is not the expected one, wait. Also increase timeout to 15 min and add comments.
1 parent dcc2965 commit fdd77d1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

scripts/bash/container_app_smoke_test.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ else
2222
ENDPOINT="https://pr-${PR_NUMBER}.${DNS_ZONE_NAME}/sha"
2323
fi
2424

25-
TIMEOUT=300
25+
# Script timeout and check interval in seconds
26+
TIMEOUT=$((15*60))
2627
INTERVAL=5
2728

2829
start_time=$(date +%s)
2930

3031
while true; do
31-
if ACTUAL_SHA=$(curl -fsSL "$ENDPOINT" 2>/dev/null); then
32-
echo "Endpoint responded: $ACTUAL_SHA"
33-
if [ "$ACTUAL_SHA" = "$EXPECTED_SHA" ]; then
34-
echo "✅ SHA matches expected commit: $EXPECTED_SHA"
35-
exit 0
36-
else
37-
echo "❌ SHA mismatch. Expected $EXPECTED_SHA but got $ACTUAL_SHA"
38-
exit 1
39-
fi
32+
# Send request to /sha URL. Only print the sha and fail if required.
33+
# It should fail initially until front door presents the right certificate.
34+
if ACTUAL_SHA=$(curl -fsS "$ENDPOINT" 2>/dev/null); then
35+
echo "Endpoint responded: $ACTUAL_SHA"
36+
if [ "$ACTUAL_SHA" = "$EXPECTED_SHA" ]; then
37+
echo "✅ SHA matches expected commit: $EXPECTED_SHA"
38+
exit 0
39+
else
40+
echo "❌ SHA mismatch. Expected $EXPECTED_SHA but got $ACTUAL_SHA"
41+
fi
4042
fi
4143

4244
now=$(date +%s)

0 commit comments

Comments
 (0)