Skip to content

Commit 8da92a5

Browse files
authored
chore: run test in devicefarm script add upload waits (#3299)
1 parent 2db2a64 commit 8da92a5

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

scripts/run_test_in_devicefarm.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,19 @@ if [[ -z "$app_package_upload_arn" ]]; then
7070
fi
7171
curl -H "Content-Type:application/octet-stream" -T $file_name $app_package_url
7272

73-
echo "Waiting for uploads to complete"
74-
sleep 10
73+
# Wait for uploads to complete
74+
for arn in "$test_package_upload_arn" "$app_package_upload_arn"; do
75+
while true; do
76+
upload_status=$(aws devicefarm get-upload --arn "$arn" --region="us-west-2" --query="upload.status" --output text)
77+
if [ "$upload_status" = "SUCCEEDED" ]; then
78+
break
79+
elif [ "$upload_status" = "FAILED" ]; then
80+
echo "Upload failed for $arn"
81+
exit 1
82+
fi
83+
sleep 5
84+
done
85+
done
7586

7687
# Get oldest device we can test against.
7788
minDevice=$(aws devicefarm list-devices \

0 commit comments

Comments
 (0)