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

add missing any/none waiter error matching #5316

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

lucix-aws
Copy link
Contributor

Adds missing functionality defined in the waiters spec:

error: A string representing the parsed AWS error code when looking for a specific error code, or boolean true to match on any error code, or boolean false to test if no errors were encountered.

Nothing actually uses this right now but I modified dynamodb's two error-match waiters with expected booleans to test generation.

aws/request/waiter_test.go Outdated Show resolved Hide resolved
State: request.RetryWaiterState,
Matcher: request.ErrorWaiterMatch,
Argument: "",
Expected: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is the actual change on behavior, returning true when there's any error even if we don't have a matcher for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is an explicitly configured matcher saying "retry if there's any error".

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, where do we actually verify the new behavior then? We setup matchers, we verify we didn't get any error and that we only tried the expected amount of times, but I'm not sure where on these tests we check for the newly added boolean error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestWaiterRetryAnyError (this one) is configured to say "retry on any error" - so that tests the positive / true case - demonstrated by the first two mocked requests resulting in a retry.

Then TestWaiterSuccessNoError just says "immediately succeed on no error" - the negative / false case - demonstrated by the very first mocked response terminating in success.

Co-authored-by: Luis Madrigal <599908+Madrigal@users.noreply.github.com>
@lucix-aws lucix-aws merged commit 070dd38 into main Jul 24, 2024
9 checks passed
@lucix-aws lucix-aws deleted the fix-waitermatchbool branch July 24, 2024 15:31
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.

3 participants