Skip to content

Commit

Permalink
Fixes flaky test org.opensearch.telemetry.metrics.TelemetryMetricsEna…
Browse files Browse the repository at this point in the history
…bledSanityIT.testGauge (#12745) (#12747)

(cherry picked from commit 2567792)

Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gagan Juneja <gjjuneja@amazon.com>
  • Loading branch information
3 people authored Mar 19, 2024
1 parent a8fa92a commit 4cd1264
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public void testHistogram() throws Exception {
assertEquals(1.0, histogramPointData.getMin(), 1.0);
}

public void testObservableGauge() throws Exception {
String metricName = "test-observable-gauge";
public void testGauge() throws Exception {
String metricName = "test-gauge";
MetricsRegistry metricsRegistry = internalCluster().getInstance(MetricsRegistry.class);
InMemorySingletonMetricsExporter.INSTANCE.reset();
Tags tags = Tags.create().addTag("test", "integ-test");
Expand All @@ -137,7 +137,7 @@ public void testObservableGauge() throws Exception {

InMemorySingletonMetricsExporter exporter = InMemorySingletonMetricsExporter.INSTANCE;

assertEquals(2.0, getMaxObservableGaugeValue(exporter, metricName), 0.0);
assertTrue(getMaxObservableGaugeValue(exporter, metricName) >= 2.0);
gaugeCloseable.close();
double observableGaugeValueAfterStop = getMaxObservableGaugeValue(exporter, metricName);

Expand Down

0 comments on commit 4cd1264

Please sign in to comment.