spanasch commented on code in PR #13991: URL: https://github.com/apache/pinot/pull/13991#discussion_r1760410946
########## pinot-common/src/test/java/org/apache/pinot/common/metrics/AbstractMetricsTest.java: ########## @@ -108,4 +112,154 @@ public void testMultipleGauges() { controllerMetrics.removeGauge(metricName2); Assert.assertTrue(controllerMetrics.getMetricsRegistry().allMetrics().isEmpty()); } + + /** + * Creates and initializes a concrete instance of {@link AbstractMetrics} (in this case, a {@code ControllerMetrics}). + * @return a {@code ControllerMetrics} suitable for testing {@code AbstractMetrics} APIs + */ + private static ControllerMetrics buildTestMetrics() { Review Comment: The main reason is to ensure each test starts with clean metrics. If all tests shared the same ControllerMetrics object, you could have one test fail because the previous test didn't fully clean the shared metrics. It also, as you mention, makes the tests parallelizable which is nice to have. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org