gnodet opened a new pull request, #22979:
URL: https://github.com/apache/camel/pull/22979

   [CAMEL-23430](https://issues.apache.org/jira/browse/CAMEL-23430)
   
   Fix two flaky tests in camel-kafka:
   
   **KafkaConsumerAutoInstResumeRouteStrategyIT.testOffsetIsBeingChecked:**
   - Producer was never flushed or closed after sending messages — messages may 
not have been delivered to Kafka when the test starts consuming
   - `mock.assertIsSatisfied()` was called without any wait timeout — the 
assertion checked immediately before the route had time to consume and process 
messages
   - Fix: use try-with-resources for the producer with an explicit flush, and 
use Awaitility to wait for the mock assertion
   
   **KafkaIdempotentRepositoryEagerIT.createRepositoryTopic** (via 
KafkaTestUtil.createTopic):
   - The `createTopics()` result was not awaited before calling 
`describeTopics()` — topic may not exist yet
   - The `describeTopics()` future had only a 5-second timeout, which is too 
tight when the Kafka broker is still warming up
   - The AdminClient was never closed, leaking resources
   - Fix: await the `createTopics()` result, increase timeout to 30 seconds, 
and use try-with-resources for the AdminClient


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to