Skip to content

Commit

Permalink
Use a Longer Delay to Test Search Clients Apply a New Date on Retry (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alzimmermsft authored Mar 31, 2022
1 parent 3b14f98 commit 283246f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.policy.ExponentialBackoffOptions;
import com.azure.core.http.policy.FixedDelay;
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 Down Expand Up @@ -135,6 +136,7 @@ public void indexClientFreshDateOnRetry() throws MalformedURLException {
.endpoint(searchEndpoint)
.credential(searchApiKeyCredential)
.indexName("test_builder")
.retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(1))))
.httpClient(new SearchIndexClientBuilderTests.FreshDateTestClient())
.buildAsyncClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.ExponentialBackoffOptions;
import com.azure.core.http.policy.FixedDelay;
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 Down Expand Up @@ -124,6 +125,7 @@ public void serviceClientFreshDateOnRetry() throws MalformedURLException {
SearchIndexAsyncClient searchIndexAsyncClient = new SearchIndexClientBuilder()
.endpoint(searchEndpoint)
.credential(searchApiKeyCredential)
.retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(1))))
.httpClient(new FreshDateTestClient())
.buildAsyncClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.ExponentialBackoffOptions;
import com.azure.core.http.policy.FixedDelay;
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 Down Expand Up @@ -124,6 +125,7 @@ public void serviceClientFreshDateOnRetry() throws MalformedURLException {
SearchIndexerAsyncClient searchIndexerAsyncClient = new SearchIndexerClientBuilder()
.endpoint(searchEndpoint)
.credential(searchApiKeyCredential)
.retryOptions(new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(1))))
.httpClient(new FreshDateTestClient())
.buildAsyncClient();

Expand Down

0 comments on commit 283246f

Please sign in to comment.