Skip to content

Commit

Permalink
chore: Make release validation more robust to transient failures (#344)
Browse files Browse the repository at this point in the history
We see transient failures in our releases because sometimes the validation
cannot find the new version that we just released due to eventual consistency.
Retry a couple times before failing to more gracefully handle this scenario.
  • Loading branch information
farleyb-amazon committed May 28, 2021
1 parent 863b04d commit db07a77
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion codebuild/release/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@ phases:
- sed -i "s/aws_encryption_sdk/aws_encryption_sdk==$VERSION/" requirements-dev.txt
build:
commands:
- tox -e test
- NUM_RETRIES=3
- |
while [ $NUM_RETRIES -gt 0 ]
do
tox -re test
if [ $? -eq 0 ]; then
break
fi
NUM_RETRIES=$((NUM_RETRIES-1))
if [ $NUM_RETRIES -eq 0 ]; then
echo "All validation attempts failed, stopping"
exit 1;
else
echo "Validation failed, retrying in 60 seconds; will retry $NUM_RETRIES more times" && sleep 60
fi
done

0 comments on commit db07a77

Please sign in to comment.