Skip to content

Commit 3b14f98

Browse files
authored
Fixed client builder tests that became flaky with the new version of Azure Core. (Azure#27985)
1 parent 852c9ea commit 3b14f98

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/TableClientBuilderTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.azure.core.exception.HttpResponseException;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.policy.ExponentialBackoffOptions;
11+
import com.azure.core.http.policy.FixedDelayOptions;
1112
import com.azure.core.http.policy.HttpLogOptions;
1213
import com.azure.core.http.policy.RetryOptions;
1314
import com.azure.core.http.policy.RetryPolicy;
@@ -21,6 +22,7 @@
2122

2223
import java.net.MalformedURLException;
2324
import java.security.SecureRandom;
25+
import java.time.Duration;
2426
import java.util.Collections;
2527

2628
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
@@ -107,6 +109,7 @@ public void serviceClientFreshDateOnRetry() throws MalformedURLException {
107109
.connectionString(connectionString)
108110
.tableName(tableName)
109111
.httpClient(new TestUtils.FreshDateTestClient())
112+
.retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(1))))
110113
.buildAsyncClient();
111114

112115
StepVerifier.create(tableAsyncClient.getHttpPipeline().send(

sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/TableServiceClientBuilderTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.azure.core.exception.HttpResponseException;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.policy.ExponentialBackoffOptions;
11+
import com.azure.core.http.policy.FixedDelayOptions;
1112
import com.azure.core.http.policy.HttpLogOptions;
1213
import com.azure.core.http.policy.RetryOptions;
1314
import com.azure.core.http.policy.RetryPolicy;
@@ -21,6 +22,7 @@
2122

2223
import java.net.MalformedURLException;
2324
import java.security.SecureRandom;
25+
import java.time.Duration;
2426
import java.util.Collections;
2527

2628
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
@@ -102,6 +104,7 @@ public void serviceClientFreshDateOnRetry() throws MalformedURLException {
102104
TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder()
103105
.connectionString(connectionString)
104106
.httpClient(new TestUtils.FreshDateTestClient())
107+
.retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(1))))
105108
.buildAsyncClient();
106109

107110
StepVerifier.create(tableServiceAsyncClient.getHttpPipeline().send(

0 commit comments

Comments
 (0)