Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit f087fd8

Browse files
edaenamtarng
andauthored
Introspection onboard test fails on pending table deletion (#303)
Co-authored-by: Michael Tarng <20913254+mtarng@users.noreply.github.com>
1 parent ad9b34d commit f087fd8

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

tests/functions.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,23 +203,6 @@ function storage_account_table_exists () {
203203
if [ "$action" == "delete" ]; then
204204
echo "Delete table '$t'"
205205
az storage table delete -n $t --account-name $sa_name
206-
total_wait_seconds=20
207-
wait_delete_seconds=50
208-
start=0
209-
wait_seconds=5
210-
while [ $start -lt $total_wait_seconds ]; do
211-
sat_result=$(az storage table exists -n $t --account-name $sa_name)
212-
sat_exists=$(echo $sat_result | jq '.exists | . == true')
213-
if [ "$sat_exists" = "false" ]; then
214-
echo "The table '$t' was marked deleted"
215-
echo "Wait $wait_delete_seconds seconds for delete..."
216-
sleep $wait_delete_seconds
217-
break
218-
fi
219-
echo "Wait $wait_seconds seconds..."
220-
sleep $wait_seconds
221-
start=$((start + wait_seconds))
222-
done
223206
fi
224207
else
225208
echo "Check if $t exists"

tests/introspection-validations.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,23 @@ sat_onboard_name=smokedeploymentstest
6868
subscription_id=$(az account list | jq '.[] | select(.isDefault == true) | .id' -r)
6969
storage_account_exists $AZ_STORAGE_ACCOUNT $AZ_RESOURCE_GROUP "fail"
7070
storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "delete"
71-
spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT
71+
72+
wait_delete_seconds=50
73+
start=0
74+
wait_seconds=5
75+
while [ $start -lt $wait_delete_seconds ]; do
76+
onboard_result=$(spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT)
77+
if [[ $onboard_result == *"table is being deleted"* ]]; then
78+
echo "Table $sat_onboard_name is still being deleted"
79+
echo "Wait $wait_seconds seconds..."
80+
sleep $wait_seconds
81+
start=$((start + wait_seconds))
82+
else
83+
echo "onboard finished"
84+
break
85+
fi
86+
done
87+
7288
storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "fail"
7389
storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "delete"
7490

0 commit comments

Comments
 (0)