Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4321#discussion_r128193424
  
    --- Diff: 
flink-connectors/flink-connector-kafka-0.9/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThreadTest.java
 ---
    @@ -744,17 +745,21 @@ void 
reassignPartitions(List<KafkaTopicPartitionState<TopicPartition>> newPartit
                        final OneShotLatch continueAssignmentLatch) {
     
                final KafkaConsumer<byte[], byte[]> mockConsumer = 
mock(KafkaConsumer.class);
    +           final AtomicInteger callCounter = new AtomicInteger();
    +
                when(mockConsumer.assignment()).thenAnswer(new Answer<Object>() 
{
                        @Override
                        public Object answer(InvocationOnMock invocationOnMock) 
throws Throwable {
    -                           if (midAssignmentLatch != null) {
    -                                   midAssignmentLatch.trigger();
    -                           }
    +                           // first call is not the one that we want to 
catch... we all love mocks, don't we?
    --- End diff --
    
    This change is no longer needed once I dropped `this.hasAssignedPartitions 
= !consumer.assignment().isEmpty();` assignment (it was `the first call` that 
was causing the problems)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to