Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add retry delays to build tests & upgrade actions/cache #6291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tiffanynwyeung
Copy link
Member

@tiffanynwyeung tiffanynwyeung commented Jan 9, 2025

Description of changes

NPM publish is flaky so our package tag publish time can experience delays, causing build system tests to fail due to install retries acting too quickly. Affects RN tests as well.

  • Add extra retry + exponential backoff delay during NPM installs in build test scripts
  • Swap RN build tests to use dependency install script so it can also use retries

Successful action run: https://github.com/aws-amplify/amplify-ui/actions/runs/12697326612

Additional:

Issue #, if available

Description of how you validated changes

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • yarn test passes and tests are updated/added
  • PR title and commit messages follow conventional commit syntax
  • If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to docs, e2e, examples, or other private packages.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tiffanynwyeung tiffanynwyeung requested a review from a team as a code owner January 9, 2025 19:35
Copy link

changeset-bot bot commented Jan 9, 2025

⚠️ No Changeset found

Latest commit: 40a8f01

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


# Sleep 5 seconds before retrying
sleep 5
# Don't add delay at end of last attempt if last attempt fails
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to scope the delay to be only between attempts. Otherwise, during the last loop iteration, an unnecessary additional (and very long) delay will happen when it should exit immediately.

@@ -17,9 +17,9 @@ if [ "$SKIP_CYPRESS_BINARY" = "true" ]; then
export CYPRESS_INSTALL_BINARY=0
fi

for i in {1..3}; do
for i in {1..4}; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the additional retry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to add an extra retry that starts after the last (and longest) delay we're deliberately adding, but without the extra retry, it will only wait a cumulative amount of 20s which will be too short still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants