XComp commented on code in PR #21762:
URL: https://github.com/apache/flink/pull/21762#discussion_r1090407495


##########
flink-metrics/flink-metrics-slf4j/src/test/java/org/apache/flink/metrics/slf4j/Slf4jReporterTest.java:
##########
@@ -57,10 +58,75 @@ static void setUp() {
                 TestMetricGroup.newBuilder()
                         .setMetricIdentifierFunction((s, characterFilter) -> 
SCOPE + delimiter + s)
                         .build();
+    }
+
+    @BeforeEach
+    void setUpReporter() {
         reporter = new Slf4jReporter();
         reporter.open(new MetricConfig());
     }
 
+    @Test
+    void testSkipOnNoMetrics() {
+        reporter.report();
+
+        assertThat(testLoggerResource.getMessages())
+                .noneMatch(logOutput -> logOutput.contains("Starting metrics 
report"))
+                .anyMatch(logOutput -> logOutput.contains("Skipping metrics 
report"));
+    }
+
+    @Test
+    void testSkipCountersIfNoCounterRegistered() {

Review Comment:
   ```suggestion
       void testOnlyCounterRegistered() {
   ```
   Isn't the test method name misleading? It's doing the opposite of what the 
name implies. 
   This applies to the other test methods below.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to