Skip to content

Commit f9480e8

Browse files
committed
fix clirr and integration test
1 parent b35d956 commit f9480e8

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

google-cloud-bigtable/clirr-ignored-differences.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
<difference>
191191
<differenceType>7004</differenceType>
192192
<className>com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker</className>
193+
<method>*</method>
193194
</difference>
194195
<difference>
195196
<differenceType>7012</differenceType>

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
207207
ProjectName name = ProjectName.of(testEnvRule.env().getProjectId());
208208

209209
// Interval is set in the monarch request when query metric timestamps.
210-
// Restrict it to before we send to request and 1 minute after we send the request. If
210+
// Restrict it to before we send to request and 3 minute after we send the request. If
211211
// it turns out to be still flaky we can increase the filter range.
212-
Instant end = Instant.now().plus(Duration.ofMinutes(1));
212+
Instant end = Instant.now().plus(Duration.ofMinutes(3));
213213
TimeInterval interval =
214214
TimeInterval.newBuilder()
215215
.setStartTime(Timestamps.fromMillis(start.toEpochMilli()))
@@ -271,9 +271,9 @@ public void testBuiltinMetricsWithCustomOTEL() throws Exception {
271271
Collection<MetricData> fromMetricReader = metricReader.collectAllMetrics();
272272

273273
// Interval is set in the monarch request when query metric timestamps.
274-
// Restrict it to before we send to request and 1 minute after we send the request. If
274+
// Restrict it to before we send to request and 3 minute after we send the request. If
275275
// it turns out to be still flaky we can increase the filter range.
276-
Instant end = start.plus(Duration.ofMinutes(1));
276+
Instant end = start.plus(Duration.ofMinutes(3));
277277
TimeInterval interval =
278278
TimeInterval.newBuilder()
279279
.setStartTime(Timestamps.fromMillis(start.toEpochMilli()))

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.UUID;
4343
import java.util.concurrent.ExecutionException;
4444
import java.util.concurrent.TimeUnit;
45+
import java.util.logging.Logger;
4546
import java.util.stream.Collectors;
4647
import org.junit.After;
4748
import org.junit.Before;
@@ -51,6 +52,8 @@
5152
public class UnaryMetricsMetadataIT {
5253
@ClassRule public static TestEnvRule testEnvRule = new TestEnvRule();
5354

55+
private static final Logger LOGGER = Logger.getLogger(UnaryMetricsMetadataIT.class.getName());
56+
5457
private BigtableDataClient client;
5558
private InMemoryMetricReader metricReader;
5659

@@ -147,14 +150,16 @@ public void testFailure() throws Exception {
147150
}
148151
}
149152

150-
List<MetricData> metrics =
151-
metricReader.collectAllMetrics().stream()
152-
.filter(m -> m.getName().contains(BuiltinMetricsConstants.OPERATION_LATENCIES_NAME))
153-
.collect(Collectors.toList());
153+
MetricData metricData = null;
154+
for (MetricData md : metricReader.collectAllMetrics()) {
155+
if (md.getName().contains(BuiltinMetricsConstants.OPERATION_LATENCIES_NAME)) {
156+
metricData = md;
157+
break;
158+
}
159+
}
154160

155-
assertThat(metrics.size()).isEqualTo(1);
161+
assertThat(metricData).isNotNull();
156162

157-
MetricData metricData = metrics.get(0);
158163
List<PointData> pointData = new ArrayList<>(metricData.getData().getPoints());
159164
List<String> clusterAttributes =
160165
pointData.stream()

0 commit comments

Comments
 (0)