Fix flaky lambda test event retry reserved concurrency#12441
Merged
Conversation
This simplifies the test case such that no transformer is required and makes the notify more explicit through a traceable `queue_url` reference.
1 task
dfangl
approved these changes
Mar 28, 2025
| This fixture can be used to obtain Boto clients with disabled retries for testing. | ||
| botocore docs: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html#configuring-a-retry-mode | ||
|
|
||
| Use this client when testing exceptions (i.e., with pytest.raises(...)) or expected errors (e.g., status code 500) |
Member
There was a problem hiding this comment.
Maybe we can clarify here, that this is mostly needed when exceptions are tested which have retries? So all listed in here: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html#legacy-retry-mode (or matching the http status codes also listed there).
For a "ResourceNotFound" exception for example, this is not necessary
Member
Author
There was a problem hiding this comment.
yeah, we are indeed using the legacy retry mode, which makes things even worse 😬 .
I wanted to keep it simple and long-term given there are no adverse effects of using the no_retry client with a non-retrying exception. Nevertheless, I added the clarification for most accurate and actionable advice at the current status.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The test
test_reserved_concurrency_async_queueis currently skipped due to flakiness.Changes
aws_client_no_retryfixture and use it in the testcaserequests_id-based assertionsTesting
Temporarily using a botocore configuration with increased retries makes the retry problem reproducible causing the test to fail. This shows that we need an
aws_client_no_retryto mitigate potential flakiness and reduce unnecessary retries.To reproduce:
TEST_DISABLE_RETRIES_AND_TIMEOUTS=0