flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnowojski <...@git.apache.org>
Subject [GitHub] flink pull request #4321: [FLINK-7174] Bump Kafka 0.10 dependency to 0.10.2....
Date Wed, 19 Jul 2017 09:12:13 GMT
Github user pnowojski commented on a diff in the pull request:

    --- 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>>
     			final OneShotLatch continueAssignmentLatch) {
     		final KafkaConsumer<byte[], byte[]> mockConsumer = mock(KafkaConsumer.class);
    +		final AtomicInteger callCounter = new AtomicInteger();
     		when(mockConsumer.assignment()).thenAnswer(new Answer<Object>() {
     			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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message