[ https://issues.apache.org/jira/browse/KAFKA-6462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16338248#comment-16338248 ]
ASF GitHub Bot commented on KAFKA-6462: --------------------------------------- guozhangwang closed pull request #4446: KAFKA-6462: fix unstable ResetIntegrationTest URL: https://github.com/apache/kafka/pull/4446 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java index 5819b6d3183..15d03329c28 100644 --- a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java @@ -24,6 +24,7 @@ import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.config.SslConfigs; import org.apache.kafka.common.config.types.Password; +import org.apache.kafka.common.errors.TimeoutException; import org.apache.kafka.common.serialization.LongDeserializer; import org.apache.kafka.common.serialization.LongSerializer; import org.apache.kafka.common.serialization.Serdes; @@ -167,11 +168,24 @@ public boolean conditionMet() { private final static Properties RESULT_CONSUMER_CONFIG = new Properties(); void prepareTest() throws Exception { - cluster.deleteAndRecreateTopics(INPUT_TOPIC, OUTPUT_TOPIC, OUTPUT_TOPIC_2, OUTPUT_TOPIC_2_RERUN); - prepareConfigs(); prepareEnvironment(); + // busy wait until cluster (ie, ConsumerGroupCoordinator) is available + while (true) { + Thread.sleep(50); + + try { + TestUtils.waitForCondition(consumerGroupInactiveCondition, TIMEOUT_MULTIPLIER * CLEANUP_CONSUMER_TIMEOUT, + "Test consumer group active even after waiting " + (TIMEOUT_MULTIPLIER * CLEANUP_CONSUMER_TIMEOUT) + " ms."); + } catch (final TimeoutException e) { + continue; + } + break; + } + + cluster.deleteAndRecreateTopics(INPUT_TOPIC, OUTPUT_TOPIC, OUTPUT_TOPIC_2, OUTPUT_TOPIC_2_RERUN); + add10InputElements(); } ---------------------------------------------------------------- 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: us...@infra.apache.org > ResetIntegrationTest unstable > ----------------------------- > > Key: KAFKA-6462 > URL: https://issues.apache.org/jira/browse/KAFKA-6462 > Project: Kafka > Issue Type: Improvement > Components: streams, unit tests > Reporter: Matthias J. Sax > Assignee: Matthias J. Sax > Priority: Minor > > {noformat} > java.util.concurrent.ExecutionException: > org.apache.kafka.common.errors.TimeoutException: Failed to update metadata > after 60000 ms. > at > org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.<init>(KafkaProducer.java:1155) > at > org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:847) > at > org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:784) > at > org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:671) > at > org.apache.kafka.streams.integration.utils.IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp(IntegrationTestUtils.java:133) > at > org.apache.kafka.streams.integration.utils.IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp(IntegrationTestUtils.java:118) > at > org.apache.kafka.streams.integration.AbstractResetIntegrationTest.add10InputElements(AbstractResetIntegrationTest.java:199) > at > org.apache.kafka.streams.integration.AbstractResetIntegrationTest.prepareTest(AbstractResetIntegrationTest.java:175) > at > org.apache.kafka.streams.integration.ResetIntegrationTest.before(ResetIntegrationTest.java:56){noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)