Skip to content

Commit

Permalink
Fixed client builder tests that became flaky with the new version of …
Browse files Browse the repository at this point in the history
…Azure Core. (#27985)
  • Loading branch information
vcolin7 authored Mar 31, 2022
1 parent 852c9ea commit 3b14f98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.policy.ExponentialBackoffOptions;
import com.azure.core.http.policy.FixedDelayOptions;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
Expand All @@ -21,6 +22,7 @@

import java.net.MalformedURLException;
import java.security.SecureRandom;
import java.time.Duration;
import java.util.Collections;

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

StepVerifier.create(tableAsyncClient.getHttpPipeline().send(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.policy.ExponentialBackoffOptions;
import com.azure.core.http.policy.FixedDelayOptions;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
Expand All @@ -21,6 +22,7 @@

import java.net.MalformedURLException;
import java.security.SecureRandom;
import java.time.Duration;
import java.util.Collections;

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

StepVerifier.create(tableServiceAsyncClient.getHttpPipeline().send(
Expand Down

0 comments on commit 3b14f98

Please sign in to comment.