-
Notifications
You must be signed in to change notification settings - Fork 864
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
feature(Waiters): Boolean Value support for Error Matchers for Waiters #5084
Conversation
…s with Error to accept true/false value not as string but as boolean values such that True value is to match on any error code, or boolean false to test if no errors were encountered as per the SDK Waiter specs.
f4aa5f9
to
b494abf
Compare
waiter.waitUntilErrorMatcherWithExpectedFalseRetries(AllTypesRequest.builder().build()); | ||
assertThat(waiterResponse.attemptsExecuted()).isEqualTo(3); | ||
// Empty because the waiter specifically waits for Error case. | ||
assertThat(waiterResponse.matched().response()).isEmpty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the response empty instead of containing the EmptyModeledException thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is existing case coming from second part of acceptor as below where we say if matcher is error and if we get exception as EmptyModeledException
then transistion to success state , since we donot have any valid response from response from server we retrurn empty response
"ErrorMatcherWithExpectedFalseRetries": {
"delay": 1,
"operation": "AllTypes",
"maxAttempts": 40,
"acceptors": [
{
"matcher" : "error",
"state" : "retry",
"expected" : false
},
{
"matcher": "error",
"expected": "EmptyModeledException",
"state": "success"
}
]
```
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"description": "Added support for Waiters specifically for Matchers with Error to accept true/false value not as string but as boolean values such that True value is to match on any error code, or boolean false to test if no errors were encountered as per the SDK Waiter specs." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : whitespace between "is to"
} | ||
|
||
/** | ||
* Case with the model just defined that it should Fail when there are no Errors But waitor does not tell what to do if there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: waitor typo
codeBlock.add(trueForAllResponse()); | ||
} else { | ||
codeBlock.add("OnExceptionAcceptor("); | ||
codeBlock.add("error -> errorCode(error) " + (expectedBoolean ? "!=" : "==") + " null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exepectedBoolean is always true in this else block, right?
codeBlock.add("error -> errorCode(error) != null");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap , this is redundant check , I removed it now.
Quality Gate failedFailed conditions |
…rs (aws#5084) * feature(Waiters): Added support for Waiters specifically for Matchers with Error to accept true/false value not as string but as boolean values such that True value is to match on any error code, or boolean false to test if no errors were encountered as per the SDK Waiter specs. * addressed review comments v1
Added support for Waiters specifically for Matchers with Error to accept true/false value not as string but as boolean values such that True value is to match on any error code, or boolean false to test if no errors were encountered as per the SDK Waiter specs.
Motivation and Context
Modifications
Testing
Cases
Screenshots (if appropriate)
Types of changes
License