test(integ): let exhausted IAM throttling fail instead of skipping#6094
Conversation
The prior mitigation converted a SimulatePrincipalPolicy throttle that survived the adaptive retries into a skipped test (pytest_runtest_makereport). That hid a persistent rate-limit regression: a genuinely throttled run would silently drop out of the results instead of showing up as a failure. Keep the autouse adaptive-retry fixture (it still absorbs transient bursts), but remove the skip conversion and its now-unused helper/constants. Throttling that exhausts the retry budget now fails the test loudly so the regression is visible.
|
Claude finished @jam-jee's task in 31s —— View job PR Review: let exhausted IAM throttling fail instead of skipping
This looks good to merge. 👍 What the PR does, and why it's right Removing the Verification
Minor observations (non-blocking, no change required)
Correctness, security, and performance are all fine here; the change is test-harness-only and touches no SDK source or public API. |
|
Claude finished @jam-jee's task in 1m 20s —— View job PR Review: let exhausted IAM throttling fail instead of skipping
The core intent of this PR is right: converting a persistent-throttle failure into a skip masks a real regression, so removing However, the deletion went one line too far and left two loose ends the diff introduced: 1. The diff removed everything after previous = {
"AWS_RETRY_MODE": os.environ.get("AWS_RETRY_MODE"),
"AWS_MAX_ATTEMPTS": os.environ.get("AWS_MAX_ATTEMPTS"),
}
os.environ["AWS_RETRY_MODE"] = _RETRY_MODE
os.environ["AWS_MAX_ATTEMPTS"] = _MAX_ATTEMPTS
yield
# (restore loop that consumed `previous` was deleted here)Now Two ways to fix, either is fine:
2. Docstring refers to a fixture name that doesn't exist — The rewritten module docstring documents the fixture as Everything else is clean — no dangling references to the removed hook/helper/constants, remaining imports ( None of these are correctness-critical at runtime (session-scoped env-var leakage is benign in a test worker), but #1 in particular leaves the code internally inconsistent with its own docstring, and both are trivial to fix before merge. |
…merge artifacts The master merge into this branch reintroduced the pytest_runtest_makereport skip hook in the train and mlops integ conftests (both landed by aws#6081), so a SimulatePrincipalPolicy throttle surviving the retries would still be silently skipped there. Remove the hook and its now-unused helper/constants from both, so exhausted throttling fails loudly in every suite. Also fix two artifacts the merge left in the serve conftest: - restore the fixture teardown that resets AWS_RETRY_MODE / AWS_MAX_ATTEMPTS (the 'previous' dict was captured but never restored -> unused-variable lint and env leak across the session); - update the stale docstring that still described the removed _configure_default_boto_retries / DEFAULT_SESSION approach.
|
Claude finished @jam-jee's task in 59s —— View job PR Review: let exhausted IAM throttling fail instead of skipping
This is clean and correct to merge. 👍 The core change — dropping Verification (all three files)
On the two issues flagged in the earlier review round — both are already resolved in the current diff:
Minor, non-blocking (pre-existing, out of scope): Correctness, security, and performance are all fine — the change is test-harness-only and touches no SDK source or public API. |
Issue
The integ-test IAM throttling mitigation (merged in #6081) included a
pytest_runtest_makereporthook that converted aSimulatePrincipalPolicythrottle surviving the adaptive retries into a skipped test. That masks a real regression: if the account is genuinely, persistently rate-limited, the affected tests silently drop out of the results instead of turning the build red. A skip reads as "not run," not "broken."Fix
Keep the transient-throttling protection, drop the failure-hiding part:
_configure_default_boto_retries(autouse, session-scoped). Adaptive retries (max_attempts=10,mode="adaptive") still smooth transient bursts, which is what fixes the common flaky-throttle case.pytest_runtest_makereportskip conversion, plus its now-unused_is_simulate_policy_throttlehelper and_THROTTLE_ERROR_CODES/_SIMULATE_OPconstants.Net effect: a throttle that exhausts the retry budget now fails the test loudly, so a persistent rate-limit regression stays visible.
Testing
python -m py_compilepasses.boto3,pytest,Config) are all still used; no orphaned references to the removed hook/helper/constants remain.Type of change
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.