pnowojski commented on a change in pull request #8455: 
[FLINK-12284,FLINK-12637][Network,Metrics]Fix the incorrect inputBufferUsage 
metric in credit-based network mode
URL: https://github.com/apache/flink/pull/8455#discussion_r294997472
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/InputBuffersMetricsTest.java
 ##########
 @@ -43,19 +45,18 @@
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
 
 /**
  * Test for input buffer usage related metrics.
  */
 public class InputBuffersMetricsTest {
 
+       private CloseableRegistry closeableRegistry = new CloseableRegistry();
 
 Review comment:
   one new issue: you can not close the same `CloseableRegistry` more then 
once, so you would have to set it up/create new instance in `@org.junit.Before` 
method. As it is now, it can be problematic if someone adds one more test or 
tries to run this test many times in a loop.
   
   nit: you could also close it in the `@After` method.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to