chore(cli-testing): add a retry for test#29871
Closed
TheRealAmazonKendra wants to merge 4 commits intomainfrom
Closed
chore(cli-testing): add a retry for test#29871TheRealAmazonKendra wants to merge 4 commits intomainfrom
TheRealAmazonKendra wants to merge 4 commits intomainfrom
Conversation
One of our tests can remove customPermissionsBoundary creates a policy using createPolicy. Change to IAM policies/roles use eventual consistency. So, while the changes will show up right away if we were to call an API to describe that policy/role, the updates may not have actually propagated to all regions yet. This is likely the cause of the intermittant test failures for this test. This change adds the eventually block and uses it to retry initial creation of this stack in the case that the policy changes have not made it to the relevant region just yet.
Contributor
Author
|
Linter isn't asking us to send this to the pipeline? |
Contributor
Author
|
@Mergifyio update |
Contributor
✅ Branch has been successfully updated |
colifran
reviewed
Apr 19, 2024
| * @param fn function to run | ||
| * @param options EventuallyOptions | ||
| */ | ||
| const eventually = async <T>(call: () => Promise<T>, options?: EventuallyOptions): Promise<T> => { |
Contributor
There was a problem hiding this comment.
Not sure if eventually is a standard naming convention but I love it.
colifran
reviewed
Apr 19, 2024
| param => (param.ParameterKey === 'InputPermissionsBoundary' && param.ParameterValue === policyName), | ||
| )).toEqual(true); | ||
| // Policy creation and consistency across regions is "almost immediate" | ||
| // See: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency |
Contributor
There was a problem hiding this comment.
Great catch on this and thank you for also adding it as a comment!
colifran
reviewed
Apr 19, 2024
| )).toEqual(true); | ||
| }; | ||
|
|
||
| await eventually(createStackWithPermissionBoundary, { maxAttempts: 3 }); |
Contributor
There was a problem hiding this comment.
Not blocking on this, but just curious why 3?
Collaborator
There was a problem hiding this comment.
Arbitrarily seemed reasonable.
Collaborator
|
@Mergifyio update |
Contributor
✅ Branch has been successfully updated |
Collaborator
|
@Mergifyio update |
Contributor
✅ Branch has been successfully updated |
Collaborator
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One of our tests
can remove customPermissionsBoundarycreates a policy using createPolicy. Change to IAM policies/roles use eventual consistency. So, while the changes will show up right away if we were to call an API to describe that policy/role, the updates may not have actually propagated to all regions yet. This is likely the cause of the intermittent test failures for this test.This change adds the
eventuallyblock and uses it to retry initial creation of this stack in the case that the policy changes have not made it to the relevant region just yet.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license