aws-cloudformation / aws-cloudformation/cloudformation-cli

Contract Tests and Throttling Exceptions - bug?

Offen
#800 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
contract tests
Vorherrschende Sprache
Python
Sterne
336
Forks
172
Ø Merge
3 T. 5 Min.
Gemergte PRs (30 T.)
3

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem handleError-Block des Handlers und der Contract-Test-Suite und konzentriere dich auf den fehlgeschlagenen Test, der auf Drosselung stößt, nachdem andere Tests ausgeführt wurden. Vergleiche sein Verhalten mit der isolierten Ausführung dieses Tests und ermittle die erwartete Behandlung einer Drosselungsantwort. Als erledigt gilt die Aufgabe, wenn die Contract-Test-Suite diesen Fall zuverlässig behandelt, ohne aufgrund vorübergehender Drosselung fehlzuschlagen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, java
Bereich
cloud, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.