Skip to content

Commit db07a77

Browse files
chore: Make release validation more robust to transient failures (#344)
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.
1 parent 863b04d commit db07a77

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

codebuild/release/validate.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,19 @@ phases:
1313
- sed -i "s/aws_encryption_sdk/aws_encryption_sdk==$VERSION/" requirements-dev.txt
1414
build:
1515
commands:
16-
- tox -e test
16+
- NUM_RETRIES=3
17+
- |
18+
while [ $NUM_RETRIES -gt 0 ]
19+
do
20+
tox -re test
21+
if [ $? -eq 0 ]; then
22+
break
23+
fi
24+
NUM_RETRIES=$((NUM_RETRIES-1))
25+
if [ $NUM_RETRIES -eq 0 ]; then
26+
echo "All validation attempts failed, stopping"
27+
exit 1;
28+
else
29+
echo "Validation failed, retrying in 60 seconds; will retry $NUM_RETRIES more times" && sleep 60
30+
fi
31+
done

0 commit comments

Comments
 (0)