-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix flaky lambda test event retry reserved concurrency #12441
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
Fix flaky lambda test event retry reserved concurrency #12441
Conversation
This simplifies the test case such that no transformer is required and makes the notify more explicit through a traceable `queue_url` reference.
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.
LGTM, nice fix of the test!
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) |
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.
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
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.
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.
Motivation
The test
test_reserved_concurrency_async_queue
is currently skipped due to flakiness.Changes
aws_client_no_retry
fixture 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_retry
to mitigate potential flakiness and reduce unnecessary retries.To reproduce:
TEST_DISABLE_RETRIES_AND_TIMEOUTS=0