[
https://issues.apache.org/jira/browse/CAMEL-23316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114167#comment-18114167
]
Guillaume Nodet commented on CAMEL-23316:
-----------------------------------------
This issue appears to have been already fixed on the main branch.
Commit *54c7915dca27* (as part of CAMEL-23430) replaced the single blocking
`describeTopics().get(5s)` call in `KafkaTestUtil.createTopic()` with an
Awaitility retry loop that polls every 1 second for up to 30 seconds, ignoring
`UnknownTopicOrPartitionException`. This directly addresses the race condition
where Kafka metadata has not yet propagated after topic creation.
Please verify against main and close if confirmed.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> Regular Kafka test failure "UnknownTopicOrPartitionException: This server
> does not host this topic-partition."
> --------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-23316
> URL: https://issues.apache.org/jira/browse/CAMEL-23316
> Project: Camel
> Issue Type: Test
> Components: camel-kafka
> Affects Versions: 4.19.0
> Reporter: Aurélien Pupier
> Priority: Minor
>
> kafka test are regularly (3 times on the last 6 builds) failing on CI with
> this kind of error:
> {noformat}
> org.opentest4j.AssertionFailedError: Exception while creating Kafka topic
> at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:47)
> at org.junit.jupiter.api.Assertions.fail(Assertions.java:157)
> at
> org.apache.camel.component.kafka.integration.common.KafkaTestUtil.createTopic(KafkaTestUtil.java:105)
> at
> org.apache.camel.processor.idempotent.kafka.KafkaIdempotentRepositoryNonEagerIT.createRepositoryTopic(KafkaIdempotentRepositoryNonEagerIT.java:50)
> Caused by: java.util.concurrent.ExecutionException:
> org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server
> does not host this topic-partition.
> at
> java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
> at
> java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
> at
> org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:173)
> at
> org.apache.camel.component.kafka.integration.common.KafkaTestUtil.createTopic(KafkaTestUtil.java:101)
> ... 1 more
> Caused by: org.apache.kafka.common.errors.UnknownTopicOrPartitionException:
> This server does not host this topic-partition. {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)