You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2024/07/24 21:09:49 UTC
(pinot) branch master updated: Remove flaky test: testUpdateAndRemoveGauge (#13684)
This is an automated email from the ASF dual-hosted git repository.
jlli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 5ef41d81bd Remove flaky test: testUpdateAndRemoveGauge (#13684)
5ef41d81bd is described below
commit 5ef41d81bd3a5998a591dd5b808919fd313c29c5
Author: Pratik Tibrewal <ti...@uber.com>
AuthorDate: Thu Jul 25 02:39:42 2024 +0530
Remove flaky test: testUpdateAndRemoveGauge (#13684)
---
.../pinot/common/metrics/AbstractMetricsTest.java | 33 ----------------------
1 file changed, 33 deletions(-)
diff --git a/pinot-common/src/test/java/org/apache/pinot/common/metrics/AbstractMetricsTest.java b/pinot-common/src/test/java/org/apache/pinot/common/metrics/AbstractMetricsTest.java
index e404b7fdcb..1ff1d1a58f 100644
--- a/pinot-common/src/test/java/org/apache/pinot/common/metrics/AbstractMetricsTest.java
+++ b/pinot-common/src/test/java/org/apache/pinot/common/metrics/AbstractMetricsTest.java
@@ -18,10 +18,6 @@
*/
package org.apache.pinot.common.metrics;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.IntStream;
import org.apache.pinot.plugin.metrics.yammer.YammerMetricsRegistry;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.metrics.PinotMetricUtils;
@@ -52,33 +48,4 @@ public class AbstractMetricsTest {
controllerMetrics.removeGauge(metricName);
Assert.assertTrue(controllerMetrics.getMetricsRegistry().allMetrics().isEmpty());
}
-
- @Test
- public void testUpdateAndRemoveGauge()
- throws InterruptedException {
- PinotConfiguration pinotConfiguration = new PinotConfiguration();
- pinotConfiguration.setProperty(CONFIG_OF_METRICS_FACTORY_CLASS_NAME,
- "org.apache.pinot.plugin.metrics.yammer.YammerMetricsFactory");
- PinotMetricUtils.init(pinotConfiguration);
- ControllerMetrics controllerMetrics = new ControllerMetrics(new YammerMetricsRegistry());
- String metricName = "test";
-
- // update and remove gauge simultaneously
- ExecutorService service = Executors.newFixedThreadPool(3);
- IntStream.range(0, 100).forEach(i -> {
- if (i % 5 == 0) {
- service.submit(() -> controllerMetrics.removeGauge(metricName));
- }
- service.submit(() -> controllerMetrics.setValueOfGauge(i, metricName));
- });
- service.shutdown();
- service.awaitTermination(1, TimeUnit.MINUTES);
-
- // The gauge should be present in both map and metrics-registry
- Assert.assertNotNull(controllerMetrics.getGaugeValue(metricName));
- Assert.assertFalse(controllerMetrics.getMetricsRegistry().allMetrics().isEmpty());
-
- controllerMetrics.removeGauge(metricName);
- Assert.assertTrue(controllerMetrics.getMetricsRegistry().allMetrics().isEmpty());
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org