Skip to content

Commit dadda56

Browse files
Merge pull request #4787 from Azure/arm-throttling-timeout
Adjusting retry timings to fix e2e failure
2 parents ccf48aa + aba35e8 commit dadda56

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/util/framework/per_invocation_framework.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ const (
7575
StandardResourceGroupExpiration = 4 * time.Hour
7676
)
7777

78+
// azureRetryOptions configures the Azure SDK retry policy for e2e tests.
79+
// The defaults (3 retries, 800ms delay) are insufficient when Azure throttles
80+
// requests with Retry-After values of 60+ seconds.
81+
var azureRetryOptions = policy.RetryOptions{
82+
MaxRetries: 6,
83+
MaxRetryDelay: 5 * time.Minute,
84+
}
85+
7886
// InvocationContext requires the following env vars
7987
// CUSTOMER_SUBSCRIPTION
8088
// AZURE_TENANT_ID
@@ -144,6 +152,7 @@ func (tc *perBinaryInvocationTestContext) getClientFactoryOptions() *azcorearm.C
144152
if tc.isDevelopmentEnvironment {
145153
return &azcorearm.ClientOptions{
146154
ClientOptions: azcore.ClientOptions{
155+
Retry: azureRetryOptions,
147156
Transport: &proxiedConnectionTransporter{
148157
delegate: tc.defaultTransport,
149158
},
@@ -156,6 +165,7 @@ func (tc *perBinaryInvocationTestContext) getClientFactoryOptions() *azcorearm.C
156165
}
157166
return &azcorearm.ClientOptions{
158167
ClientOptions: azcore.ClientOptions{
168+
Retry: azureRetryOptions,
159169
PerCallPolicies: []policy.Policy{
160170
NewLROPollerRetryDeploymentNotFoundPolicy(),
161171
&sanitizeAuthHeaderPolicy{},
@@ -172,6 +182,7 @@ func (tc *perBinaryInvocationTestContext) getHCPClientFactoryOptions() *azcorear
172182
}
173183
return &azcorearm.ClientOptions{
174184
ClientOptions: azcore.ClientOptions{
185+
Retry: azureRetryOptions,
175186
Cloud: cloud.Configuration{
176187
ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/",
177188
Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
@@ -194,6 +205,7 @@ func (tc *perBinaryInvocationTestContext) getHCPClientFactoryOptions() *azcorear
194205
}
195206
return &azcorearm.ClientOptions{
196207
ClientOptions: azcore.ClientOptions{
208+
Retry: azureRetryOptions,
197209
PerCallPolicies: []policy.Policy{
198210
&sanitizeAuthHeaderPolicy{},
199211
},

0 commit comments

Comments
 (0)