Skip to content

Commit 6732ae1

Browse files
committed
More testing of the error codes from ecs describe-tasks
1 parent d4beed4 commit 6732ae1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

playwright/run_playwright_tests.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,24 @@ ATTEMPT=0
108108
echo "⏳ Waiting up to $MAX_WAIT_MINUTES minutes for ECS task to stop..."
109109

110110
STATUS=""
111+
ATTEMPT=0
111112

112113
while [[ $ATTEMPT -lt $MAX_ATTEMPTS ]]; do
114+
# Temporarily allow command failures
113115
set +e
114-
aws_output=$(aws ecs describe-tasks \
116+
STATUS=$(aws ecs describe-tasks \
115117
--cluster "$CLUSTER_NAME" \
116118
--tasks "$TASK_ARN" \
117119
--region "$AWS_REGION" \
118120
--query 'tasks[0].lastStatus' \
119121
--output text 2>&1)
120-
cmd_status=$?
122+
STATUS_EXIT_CODE=$?
121123
set -e
122124

123-
if [[ $cmd_status -ne 0 || "$aws_output" == *"error"* || "$aws_output" == *"Unable to"* || -z "$aws_output" ]]; then
124-
echo "⚠️ Could not fetch ECS task status (attempt $ATTEMPT): $aws_output"
125+
if [[ $STATUS_EXIT_CODE -ne 0 || "$STATUS" == *"error"* || "$STATUS" == *"Unable to"* || -z "$STATUS" ]]; then
126+
echo "⚠️ Could not fetch ECS task status (attempt $ATTEMPT): $STATUS"
125127
STATUS=""
126128
else
127-
STATUS="$aws_output"
128129
echo "🔁 Task status: $STATUS (attempt $ATTEMPT)"
129130
fi
130131

@@ -137,7 +138,6 @@ while [[ $ATTEMPT -lt $MAX_ATTEMPTS ]]; do
137138
((ATTEMPT++))
138139
done
139140

140-
141141
if [[ "$STATUS" != "STOPPED" ]]; then
142142
echo "❌ ECS task did not stop within $MAX_WAIT_MINUTES minutes." >&2
143143
exit 1

0 commit comments

Comments
 (0)