summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Cogoluègnes <acogoluegnes@gmail.com>2021-05-06 15:34:18 +0200
committerArnaud Cogoluègnes <acogoluegnes@gmail.com>2021-05-06 15:34:18 +0200
commitbb1d3c60ea784d0aea317bc9226fad5a7ee66867 (patch)
tree486652239d831a329a7b1856c4d0df696882b10e
parentf8f8b4b0694320546052f2c95d269214db6cf568 (diff)
downloadrabbitmq-server-git-bb1d3c60ea784d0aea317bc9226fad5a7ee66867.tar.gz
Fix stream prometheus test suite
Consumers now start consuming from offset last, so first must be set explicitly.
-rw-r--r--deps/rabbitmq_stream_prometheus/test/prometheus_http_SUITE_data/src/test/java/com/rabbitmq/stream/PrometheusHttpTest.java37
1 files changed, 27 insertions, 10 deletions
diff --git a/deps/rabbitmq_stream_prometheus/test/prometheus_http_SUITE_data/src/test/java/com/rabbitmq/stream/PrometheusHttpTest.java b/deps/rabbitmq_stream_prometheus/test/prometheus_http_SUITE_data/src/test/java/com/rabbitmq/stream/PrometheusHttpTest.java
index e8290d624c..b3c339f892 100644
--- a/deps/rabbitmq_stream_prometheus/test/prometheus_http_SUITE_data/src/test/java/com/rabbitmq/stream/PrometheusHttpTest.java
+++ b/deps/rabbitmq_stream_prometheus/test/prometheus_http_SUITE_data/src/test/java/com/rabbitmq/stream/PrometheusHttpTest.java
@@ -16,10 +16,25 @@
package com.rabbitmq.stream;
-import static com.rabbitmq.stream.MetricsUtils.*;
+import static com.rabbitmq.stream.MetricsUtils.METRICS;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_CONSUMERS;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_CONSUMERS_CONSUMED;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_PUBLISHERS;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_PUBLISHERS_CONFIRMED;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_PUBLISHERS_ERRORED;
+import static com.rabbitmq.stream.MetricsUtils.METRIC_PUBLISHERS_PUBLISHED;
+import static com.rabbitmq.stream.MetricsUtils.Metric;
+import static com.rabbitmq.stream.MetricsUtils.MetricValue;
import static com.rabbitmq.stream.MetricsUtils.parseMetrics;
-import static com.rabbitmq.stream.TestUtils.*;
+import static com.rabbitmq.stream.TestUtils.counter;
+import static com.rabbitmq.stream.TestUtils.gauge;
+import static com.rabbitmq.stream.TestUtils.help;
+import static com.rabbitmq.stream.TestUtils.noValue;
+import static com.rabbitmq.stream.TestUtils.value;
+import static com.rabbitmq.stream.TestUtils.valueCount;
+import static com.rabbitmq.stream.TestUtils.valuesWithLabels;
import static com.rabbitmq.stream.TestUtils.waitUntil;
+import static com.rabbitmq.stream.TestUtils.zero;
import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.condition.AllOf.allOf;
@@ -64,6 +79,14 @@ public class PrometheusHttpTest {
return "http://localhost:" + TestUtils.prometheusPort() + "/metrics" + endpoint;
}
+ static Metrics metrics() throws IOException {
+ return parseMetrics(get(""));
+ }
+
+ static Metrics metricsPerObject() throws IOException {
+ return parseMetrics(get("/per-object"));
+ }
+
@ParameterizedTest
@CsvSource({
METRIC_PUBLISHERS + ",true",
@@ -149,6 +172,7 @@ public class PrometheusHttpTest {
.mapToObj(
i ->
env.consumerBuilder().stream(streams.get(i % streams.size()))
+ .offset(OffsetSpecification.first())
.messageHandler((ctx, msg) -> consumedLatch.countDown())
.build())
.collect(toList());
@@ -245,6 +269,7 @@ public class PrometheusHttpTest {
.mapToObj(
i ->
env.consumerBuilder().stream(streams.get(i % streams.size()))
+ .offset(OffsetSpecification.first())
.messageHandler((ctx, msg) -> consumedLatch.countDown())
.build())
.collect(toList());
@@ -277,12 +302,4 @@ public class PrometheusHttpTest {
env.close();
}
}
-
- static Metrics metrics() throws IOException {
- return parseMetrics(get(""));
- }
-
- static Metrics metricsPerObject() throws IOException {
- return parseMetrics(get("/per-object"));
- }
}