Croway opened a new pull request, #2031:
URL: https://github.com/apache/camel-spring-boot/pull/2031

   ## Summary
   
   Camel-Spring-Boot Daily `main` #397 and #398 were UNSTABLE because of one 
Kafka IT each, both receiving 0 of the expected 5 messages:
   
   - #397: `KafkaConsumerFullIT.kafkaMessageIsConsumedByCamel`
   - #398: `KafkaShareConsumerIT.consumesRecordsUsingAutoConfiguredComponent`
   
   ### Root cause
   
   `MockEndpoint.assertIsSatisfied(long timeoutForEmptyEndpoints)` uses its 
argument only when the endpoint expects **zero** messages. Otherwise it waits 
on `resultWaitTime`, which defaults to 10s. So `work.assertIsSatisfied(60000)` 
and `to.assertIsSatisfied(3000)` both waited only 10s. The #398 log shows this: 
the records were produced at 21:00:28.6, and the mock logged "The latch did not 
reach 0 within the specified time" at 21:00:38.6, exactly 10s later. All six 
share consumers had joined the group one second before the records were 
produced, so the broker on the CI agent was just slow.
   
   ### Changes
   
   - `KafkaShareConsumerIT`: use `MockEndpoint.assertIsSatisfied(60, 
TimeUnit.SECONDS, work)` so the intended 60s timeout applies. This matches the 
other test in the class.
   - `KafkaConsumerFullIT`:
     - Use `MockEndpoint.assertIsSatisfied(30, TimeUnit.SECONDS, to)` where 
messages are expected. The wait time is set at each call site because 
`to.reset()` clears `resultWaitTime`. The `expectedMessageCount(0)` check keeps 
`to.assertIsSatisfied(3000)`, where the argument works as intended.
     - Port the apache/camel flakiness fix from CAMEL-19358 
(apache/camel@58966a9af302), which was never applied to this copy:
       - unique topic and route names per run
       - `@AfterEach` waits for the topic deletion to complete instead of 
firing it and moving on while the consumer is still subscribed
   
   The same `work.assertIsSatisfied(60000)` pattern is still present upstream 
in `components/camel-kafka-share/.../KafkaShareConsumerIT.java`.
   
   ### Testing
   
   Ran `KafkaConsumerFullIT` (5 tests) and `KafkaShareConsumerIT` (2 tests) 
locally against the test-infra Kafka container. All green. These failures were 
intermittent, so the next few Daily runs will confirm.
   
   _Claude Code (Claude Opus 5.5) on behalf of Federico Mariani_
   


-- 
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