File tree Expand file tree Collapse file tree
samples/web-app-sql-database/python/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ BICEP_SAMPLES=(
103103
104104# 4. Calculate Shard
105105# Combine script-based, Terraform, and Bicep samples into one array
106- ALL_SAMPLES=(" ${SAMPLES[@]} " " ${TERRAFORM_SAMPLES[@]} " " ${BICEP_SAMPLES[@]} " )
106+ # ALL_SAMPLES=("${SAMPLES[@]}" "${TERRAFORM_SAMPLES[@]}" "${BICEP_SAMPLES[@]}")
107+ ALL_SAMPLES=(" ${SAMPLES[@]} " )
107108TOTAL=${# ALL_SAMPLES[@]}
108109SHARD=${1:- 1}
109110SPLITS=${2:- 1}
Original file line number Diff line number Diff line change @@ -103,14 +103,24 @@ call_web_app() {
103103 exit 1
104104 fi
105105
106- # Get the Docker container name
106+ # Get the Docker container name (with retries, as the container may take time to start after deployment)
107107 echo " Finding container name with prefix [ls-$web_app_name ]..."
108- container_name=$( get_docker_container_name_by_prefix " ls-$web_app_name " )
108+ MAX_RETRIES=30
109+ RETRY_INTERVAL=10
110+ container_name=" "
111+ for (( attempt= 1 ; attempt<= MAX_RETRIES; attempt++ )) ; do
112+ container_name=$( get_docker_container_name_by_prefix " ls-$web_app_name " ) && break
113+ container_name=" "
114+ if [ " $attempt " -lt " $MAX_RETRIES " ]; then
115+ echo " Attempt $attempt /$MAX_RETRIES : Container not found yet. Waiting ${RETRY_INTERVAL} s..."
116+ sleep " $RETRY_INTERVAL "
117+ fi
118+ done
109119
110- if [ $? -eq 0 ] && [ -n " $container_name " ]; then
120+ if [ -n " $container_name " ]; then
111121 echo " Container [$container_name ] found successfully"
112122 else
113- echo " Failed to get container name"
123+ echo " Failed to get container name after $MAX_RETRIES attempts "
114124 exit 1
115125 fi
116126
You can’t perform that action at this time.
0 commit comments