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 (opensearch-project#12745)

Signed-off-by: Gagan Juneja <[email protected]>
Co-authored-by: Gagan Juneja <[email protected]>
  • Loading branch information
Gaganjuneja and Gagan Juneja authored Mar 19, 2024
1 parent a499d1e commit 2567792
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 2567792

Please sign in to comment.