Skip to content

Commit bda3fe9

Browse files
committed
Revert "bole_fix_write_throughpt"
This reverts commit 4745297.
1 parent 4745297 commit bda3fe9

3 files changed

Lines changed: 8 additions & 24 deletions

File tree

.changes/next-release/bugfix-AWSSDKforJavav2-4209c25.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/metrics/AsyncWriteThroughputMetricTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@
3838
import software.amazon.awssdk.regions.Region;
3939
import software.amazon.awssdk.services.protocolrestjson.ProtocolRestJsonAsyncClient;
4040
import software.amazon.awssdk.services.testutil.MockIdentityProviderUtil;
41-
import software.amazon.awssdk.utils.StringUtils;
4241

4342
/**
4443
* Functional tests for WRITE_THROUGHPUT metric for async client using WireMock.
4544
*/
4645
@WireMockTest
4746
public class AsyncWriteThroughputMetricTest {
4847

49-
// Use a larger payload to ensure multiple chunks and different first/last byte timestamps
50-
private static final String LARGE_PAYLOAD = StringUtils.repeat("x", 128 * 1024);
51-
5248
private MetricPublisher mockPublisher;
5349
private ProtocolRestJsonAsyncClient client;
5450

@@ -75,7 +71,7 @@ public void streamingInputOperation_withRequestBody_writeThroughputReported() {
7571
stubFor(post(anyUrl())
7672
.willReturn(aResponse().withStatus(200).withBody("{}")));
7773

78-
client.streamingInputOperation(r -> r.build(), AsyncRequestBody.fromString(LARGE_PAYLOAD)).join();
74+
client.streamingInputOperation(r -> r.build(), AsyncRequestBody.fromString("test body content")).join();
7975

8076
ArgumentCaptor<MetricCollection> collectionCaptor = ArgumentCaptor.forClass(MetricCollection.class);
8177
verify(mockPublisher).publish(collectionCaptor.capture());
@@ -112,7 +108,7 @@ public void nonStreamingOperation_withRequestBody_writeThroughputReported() {
112108
stubFor(post(anyUrl())
113109
.willReturn(aResponse().withStatus(200).withBody("{}")));
114110

115-
client.allTypes(r -> r.stringMember(LARGE_PAYLOAD)).join();
111+
client.allTypes(r -> r.stringMember("test")).join();
116112

117113
ArgumentCaptor<MetricCollection> collectionCaptor = ArgumentCaptor.forClass(MetricCollection.class);
118114
verify(mockPublisher).publish(collectionCaptor.capture());

test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/metrics/SyncWriteThroughputMetricTest.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@
3838
import software.amazon.awssdk.regions.Region;
3939
import software.amazon.awssdk.services.protocolrestjson.ProtocolRestJsonClient;
4040
import software.amazon.awssdk.services.testutil.MockIdentityProviderUtil;
41-
import software.amazon.awssdk.utils.StringUtils;
4241

4342
/**
4443
* Functional tests for WRITE_THROUGHPUT metric using WireMock.
4544
*/
4645
@WireMockTest
4746
public class SyncWriteThroughputMetricTest {
4847

49-
// Use a larger payload to ensure multiple chunks and different first/last byte timestamps
50-
private static final String LARGE_PAYLOAD = StringUtils.repeat("x", 128 * 1024);
51-
5248
private MetricPublisher mockPublisher;
5349
private ProtocolRestJsonClient client;
5450

@@ -75,7 +71,7 @@ public void streamingInputOperation_withRequestBody_writeThroughputReported() {
7571
stubFor(post(anyUrl())
7672
.willReturn(aResponse().withStatus(200).withBody("{}")));
7773

78-
client.streamingInputOperation(r -> r.build(), RequestBody.fromString(LARGE_PAYLOAD));
74+
client.streamingInputOperation(r -> r.build(), RequestBody.fromString("test body content"));
7975

8076
ArgumentCaptor<MetricCollection> collectionCaptor = ArgumentCaptor.forClass(MetricCollection.class);
8177
verify(mockPublisher).publish(collectionCaptor.capture());
@@ -85,9 +81,8 @@ public void streamingInputOperation_withRequestBody_writeThroughputReported() {
8581

8682
assertThat(attemptMetrics).hasSize(1);
8783
List<Double> writeThroughputValues = attemptMetrics.get(0).metricValues(CoreMetric.WRITE_THROUGHPUT);
88-
//TODO fix the test so that we are testing the write throughpt
89-
// assertThat(writeThroughputValues).hasSize(1);
90-
// assertThat(writeThroughputValues.get(0)).isGreaterThan(0);
84+
assertThat(writeThroughputValues).hasSize(1);
85+
assertThat(writeThroughputValues.get(0)).isGreaterThan(0);
9186
}
9287

9388
@Test
@@ -113,7 +108,7 @@ public void nonStreamingOperation_withRequestBody_writeThroughputReported() {
113108
stubFor(post(anyUrl())
114109
.willReturn(aResponse().withStatus(200).withBody("{}")));
115110

116-
client.allTypes(r -> r.stringMember(LARGE_PAYLOAD));
111+
client.allTypes(r -> r.stringMember("test"));
117112

118113
ArgumentCaptor<MetricCollection> collectionCaptor = ArgumentCaptor.forClass(MetricCollection.class);
119114
verify(mockPublisher).publish(collectionCaptor.capture());
@@ -123,8 +118,7 @@ public void nonStreamingOperation_withRequestBody_writeThroughputReported() {
123118

124119
assertThat(attemptMetrics).hasSize(1);
125120
List<Double> writeThroughputValues = attemptMetrics.get(0).metricValues(CoreMetric.WRITE_THROUGHPUT);
126-
//TODO fix the test so that we are testing the write throughpt
127-
// assertThat(writeThroughputValues).hasSize(1);
128-
// assertThat(writeThroughputValues.get(0)).isGreaterThan(0);
121+
assertThat(writeThroughputValues).hasSize(1);
122+
assertThat(writeThroughputValues.get(0)).isGreaterThan(0);
129123
}
130124
}

0 commit comments

Comments
 (0)