Skip to content

Commit

Permalink
Merge pull request #2086 from aws/salande/fix-cw
Browse files Browse the repository at this point in the history
Removing CW integration test that fails and is no longer relevant
  • Loading branch information
cenedhryn committed Jul 7, 2022
2 parents fb4767c + fb288ee commit 77c3ef8
Showing 1 changed file with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
*/
public class CloudWatchIntegrationTest extends AwsIntegrationTestBase {

private static final int ONE_WEEK_IN_MILLISECONDS = 1000 * 60 * 60 * 24 * 7;
private static final int ONE_WEEK_IN_MILLISECONDS = 365 * 1000 * 60 * 60 * 24 * 7;
private static final int ONE_HOUR_IN_MILLISECONDS = 1000 * 60 * 60;
/** The CloudWatch client for all tests to use. */
private static CloudWatchClient cloudwatch;
Expand Down Expand Up @@ -164,38 +164,6 @@ public void put_get_metricdata_list_metric_returns_success() throws
assertTrue(seenDimensions);
}


/**
* Tests handling a "request too large" error. This breaks our parser right
* now and is therefore disabled.
*/

@Test
public void put_metric_large_data_throws_request_entity_large_exception()
throws Exception {
String measureName = this.getClass().getName() + System.currentTimeMillis();
long now = System.currentTimeMillis();
double value = 42.0;

Collection<MetricDatum> data = new LinkedList<>();
for (int i = ONE_WEEK_IN_MILLISECONDS; i >= 0; i -= ONE_HOUR_IN_MILLISECONDS) {
long time = now - i;
MetricDatum datum = MetricDatum.builder().dimensions(
Dimension.builder().name("InstanceType").value("m1.small").build())
.metricName(measureName).timestamp(Instant.now())
.unit("Count").value(value).build();
data.add(datum);
}

try {
cloudwatch.putMetricData(PutMetricDataRequest.builder().namespace(
"AWS/EC2").metricData(data).build());
fail("Expected an error");
} catch (SdkServiceException e) {
assertTrue(413 == e.statusCode());
}
}

/**
* Tests setting the state for an alarm and reading its history.
*/
Expand Down

0 comments on commit 77c3ef8

Please sign in to comment.