Skip to content

Commit

Permalink
Fix LIVE mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Siegel committed Sep 4, 2020
1 parent ae88645 commit f618bc9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ protected void beforeTest() {
if (interceptorManager.isPlaybackMode()) {
builder.httpClient(interceptorManager.getPlaybackClient());
} else {
builder.httpClient(HttpClient.createDefault())
.addPolicy(interceptorManager.getRecordPolicy())
.addPolicy(new RetryPolicy());
builder.httpClient(HttpClient.createDefault());
if (!interceptorManager.isLiveMode()) {
builder.addPolicy(interceptorManager.getRecordPolicy());
}
builder.addPolicy(new RetryPolicy());
}

serviceClient = builder.buildAsyncClient();
Expand Down Expand Up @@ -233,7 +235,7 @@ void serviceListTablesWithTopAsync() {
serviceClient.createTable(tableName2),
serviceClient.createTable(tableName3)
).block(TIMEOUT);

// Act & Assert
StepVerifier.create(serviceClient.listTables(options))
.expectNextCount(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ protected void beforeTest() {
if (interceptorManager.isPlaybackMode()) {
builder.httpClient(interceptorManager.getPlaybackClient());
} else {
builder.httpClient(HttpClient.createDefault())
.addPolicy(interceptorManager.getRecordPolicy())
.addPolicy(new RetryPolicy());
builder.httpClient(HttpClient.createDefault());
if (!interceptorManager.isLiveMode()) {
builder.addPolicy(interceptorManager.getRecordPolicy());
}
builder.addPolicy(new RetryPolicy());
}

serviceClient = builder.buildClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ protected void beforeTest() {
playbackClient = interceptorManager.getPlaybackClient();
builder.httpClient(playbackClient);
} else {
recordPolicy = interceptorManager.getRecordPolicy();
builder.httpClient(HttpClient.createDefault())
.addPolicy(recordPolicy)
.addPolicy(new RetryPolicy());
builder.httpClient(HttpClient.createDefault());
if (!interceptorManager.isLiveMode()) {
builder.addPolicy(interceptorManager.getRecordPolicy());
}
builder.addPolicy(new RetryPolicy());
}

tableClient = builder.buildAsyncClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ protected void beforeTest() {
httpClientToUse = interceptorManager.getPlaybackClient();
} else {
httpClientToUse = HttpClient.createDefault();
HttpPipelinePolicy recordPolicy = interceptorManager.getRecordPolicy();
policies.add(recordPolicy);
if (!interceptorManager.isLiveMode()) {
HttpPipelinePolicy recordPolicy = interceptorManager.getRecordPolicy();
policies.add(recordPolicy);
}
policies.add(new RetryPolicy());
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/tables/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
Timeout: 60
MaxParallel: 12
EnvVars:
AZURE_TEST_MODE: RECORD
AZURE_TEST_MODE: LIVE
Artifacts:
- name: azure-data-tables
groupId: com.azure
Expand Down

0 comments on commit f618bc9

Please sign in to comment.