tillrohrmann commented on a change in pull request #7020: [FLINK-10774] [Kafka] 
connection leak when partition discovery is disabled an…
URL: https://github.com/apache/flink/pull/7020#discussion_r246072202
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBaseTest.java
 ##########
 @@ -464,6 +466,34 @@ public void go() throws Exception {
                runThread.sync();
        }
 
+       @Test
+       public void testClosePartitionDiscovererWhenOpenThrowException() throws 
Exception {
+               final AbstractPartitionDiscoverer mockPartitionDiscoverer = 
mock(AbstractPartitionDiscoverer.class);
 
 Review comment:
   If possible I would like to avoid using a mock here. Instead we could 
implement our own `FailingPartitionDiscoverer` which knows if it was closed. 
Moreover, we could then override the `discoverPartitions` methods to throw an 
exception to simulate a proper exception.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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