aws-cloudformation / aws-cloudformation/cloudformation-cli
Contract Tests and Throttling Exceptions - bug?
- Dominant language
- Python
- Stars
- 336
- Forks
- 172
- Avg merge
- 3d 5m
- Merged PRs (30d)
- 3
Description
Hello - my resource, AWS::ApiGateway::UsagePlan throttles UpdateUsagePlan APIs to 1 every 20 seconds. I handle this in the code using the following `handleError` block -
```
} else if (sdkException instanceof TooManyRequestsException || sdkException instanceof LimitExceededException) {
cfnEx = new CfnThrottlingException(sdkException);
} else {
cfnEx = new CfnInternalFailureException(sdkException);
}
return ProgressEvent.failed(resourceModel, callbackContext, cfnEx.getErrorCode(), cfnEx.getMessage());
```
When I try to test throttling, I see that the Handle returns a Failed state, but continues to retry and the stack succeeds eventually. But, when I run my contract test suite, I see that towards the end of the contract test suite, I see that one of the contract test fails because it runs into a throttling error. But since the Handler returns a failed status, the tests simply fail instead of waiting for the handler to eventually succeed.
How do we deal with this? If I run the failed contract test standalone then, the test passes.
Contributor guide
Assessment
This issue has not been assessed yet.