Skip to content

Commit

Permalink
fix: increase IAM wait timeout in integ test (#5504)
Browse files Browse the repository at this point in the history
Survive occasional latency spikes that exceed 1 minute.
  • Loading branch information
rix0rrr authored and mergify[bot] committed Dec 21, 2019
1 parent 5a4874b commit f10b3e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/aws-cdk/test/integ/cli/test-cdk-deploy-with-role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ aws iam put-role-policy \
}]
}')

for i in $(seq 1 10); do
# 5 minutes
attempts=60
for i in $(seq 1 $attempts); do
if aws sts assume-role --role-arn ${role_arn} --role-session-name testing >/dev/null; then
echo "Successfully assumed newly created role"
break;
elif [ $i -lt 10 ]; then
elif [ $i -lt $attempts ]; then
echo "Sleeping 5 seconds to improve chances of the role having propagated"
sleep 5
else
echo "Failed to assume role after 10 attempts, exiting."
echo "Failed to assume role after $attempts attempts, exiting."
exit 1
fi
done
Expand Down

0 comments on commit f10b3e6

Please sign in to comment.