cloudformation-cli
cloudformation-cli copied to clipboard
Contract Tests and Throttling Exceptions - bug?
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.