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

fix: race condition provisioning default apigw responses #731

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

edwardfoyle
Copy link
Member

@edwardfoyle edwardfoyle commented Aug 13, 2022

Description of changes

Functional changes are in _setDeploymentResource. All other changes were auto-fixed by the linter or me trying to make the linter happy while not bloating the PR too much.

This change fixes the flakiness we have seen in apigw.test.ts where the default CORS headers are not included in 4xx and 5xx responses. This was caused because the REST API, default responses and REST API deployment are all separate CFN resources. The REST API deployment has an implicit dependency on the REST API, but the default responses must also be provisioned before the REST API deployment is provisioned. There was a race condition where sometimes the default responses would be provisioned in time and sometimes not. This PR adds an explicit dependency between the REST API deployment and the default response resources

Issue #, if available

https://app.circleci.com/pipelines/github/aws-amplify/amplify-cli/10233/workflows/6d1d1682-c1d9-4265-b012-096c9db2e4c7/jobs/331564 (one of many flakes)

Description of how you validated changes

It's difficult to be 100% sure this fixes it because of the nature of intermittent failures, but I ran the test locally a few times and they all passed after this change

Checklist

  • PR description included
  • yarn test passes

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

@edwardfoyle edwardfoyle requested a review from a team as a code owner August 13, 2022 01:09
AaronZyLee
AaronZyLee previously approved these changes Aug 15, 2022
sundersc
sundersc previously approved these changes Aug 15, 2022
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.

None yet

4 participants