-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Step Functions: Migrate v2 Test Suite to no_retry aws_client Fixture #12461
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
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 32m 55s ⏱️ - 1h 16m 38s Results for commit fcd2f1b. ± Comparison against base commit e1f3422. This pull request removes 2842 tests.
♻️ This comment has been updated with latest results. |
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.
Good idea to pro-actively adopt the new aws_client_no_retry
🚀
However, we should avoid replacing all clients and use aws_client_no_retry
only "when testing exceptions (i.e., with pytest.raises(...)) or expected errors (e.g., status code 500)" https://github.com/localstack/localstack/pull/12441/files#diff-2776b578d9cfe9e8eaed135a0f652801d1e00d4bfee6eed855d6d097fc33f8c0R76
Retries actually help to reduce flakiness, especially when running tests against AWS.
All credits go to @dfangl for noticing this :)
Thank you! I have updated these changes to only use the |
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.
This change highlights the extensive test coverage of exception cases for StepFunctions 🙌 ✨
I’d also consider that negative scenarios may not always be immune to flakiness—something that may be interesting to reflect on for our testing approach.
Very good point and something to observe while updating snapshots. Given this process is currently manual, I don't think it's a problem for now. Re-running the entire test using pytest-rerunfailures
could be a suitable alternative here to a conditional client configuration.
@@ -142,11 +142,8 @@ def test_invalid_logging_configuration( | |||
|
|||
sm_name = f"statemachine_{short_uid()}" | |||
|
|||
stepfunctions_client = aws_client_factory( | |||
config=Config(parameter_validation=False) |
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.
nice catch that parameter validation disabling didn't seem necessary here 👍
Motivation
To minimize unnecessary retries of boto actions, a
_no_retry
variant of theaws_client
boto client factory fixture was recently introduced in #12441.These changes aim to migrate the SFN v2 test suite to use this new fixture. By doing so, we eliminate redundant retries that occur during negative snapshot tests, but also in potential flaky tests in the test suite.
Changes
aws_client
boto client factory toaws_client_no_retry