Retry IAM calls on throttling in RuntimeSupport integration tests#2458
Open
GarrettBeatty wants to merge 1 commit into
Open
Retry IAM calls on throttling in RuntimeSupport integration tests#2458GarrettBeatty wants to merge 1 commit into
GarrettBeatty wants to merge 1 commit into
Conversation
The RuntimeSupport integration tests now run in parallel, and each test class provisions its own IAM role (GetRole/CreateRole/AttachRolePolicy at startup, ListAttachedRolePolicies/DetachRolePolicy/DeleteRole at teardown). The IAM control-plane APIs have low request-rate limits, so the parallel burst intermittently throttles with 'Rate exceeded', failing TestAllNET10HandlersAsync and TestThreadingLogging in setup rather than on any assertion. Wrap the IAM calls in a throttle-aware retry with exponential backoff so the parallel startup/teardown burst is smoothed instead of failing.
normj
approved these changes
Jul 2, 2026
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.
Problem
The
Run Tests on AWSCodeBuild step has been intermittently failing (e.g. run 28538095638) with 2 of 24 tests failing inAmazon.Lambda.RuntimeSupport.IntegrationTests:CustomRuntimeNET10Tests.TestAllNET10HandlersAsyncCustomRuntimeAspNetCoreMinimalApiCustomSerializerTest.TestThreadingLoggingBoth fail identically during test setup, not on any assertion:
Root cause
The integration tests now run in parallel (#2451). Each test class uses a unique function name and sets
ExecutionRoleName = FunctionName, so every test provisions its own IAM role —GetRole/CreateRole/AttachRolePolicyat startup andListAttachedRolePolicies/DetachRolePolicy/DeleteRoleat teardown. IAM's control-plane APIs have low request-rate limits, so the concurrent burst intermittently throttles withRate exceeded, and the SDK's default retries aren't enough under this contention.Fix
Wrap the IAM calls in
BaseCustomRuntimeTestwith a throttle-aware retry (exponential backoff, 2s → capped 30s, up to 8 attempts). This smooths the parallel startup/teardown burst instead of failing the test. Throttling is detected via HTTP 429, throttle-family error codes, and theRate exceededmessage.Follows the test-stabilization theme of #2451. Test-only change — no shipped package affected, so no change file (matching #2451).