[ 
https://issues.apache.org/jira/browse/CAMEL-25628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127108#comment-18127108
 ] 

Guillaume Nodet commented on CAMEL-25628:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Root cause analysis: Two flakiness issues were identified:
1. Missing @AfterEach cleanup - no producer.close(), no endpoint.close(), no 
route removal - causes ProducerBusyException when running with -T1C or across 
test methods.
2. Hardcoded topic URI via @EndpointInject and hardcoded producer name 
"camel-producer-1" cause cross-test contamination with other Pulsar ITs sharing 
the same singleton container.

The fix pattern is already established in commit 7be7e46fb6bb (CAMEL-23880), 
which fixed the same issues in PulsarConsumerNoAcknowledgementIT, 
PulsarConsumerNegativeAcknowledgementIT, and PulsarConsumerReadCompactedIT. The 
same pattern needs to be applied to PulsarCustomMessageReceiptIT.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> Fix flaky PulsarCustomMessageReceiptIT
> --------------------------------------
>
>                 Key: CAMEL-25628
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25628
>             Project: Camel
>          Issue Type: Test
>          Components: camel-pulsar
>    Affects Versions: 4.24.0
>            Reporter: Aurélien Pupier
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> failed 1 time and falky one time in last 2 days when built with -T1C. it was 
> also flaky one time on main in last 90 days
> first error
> {noformat}
>  org.mockito.exceptions.verification.TooFewActualInvocations: 
> pulsarMessageReceipt.acknowledge();Wanted *at least* 2 times:-> at 
> org.apache.camel.component.pulsar.integration.PulsarCustomMessageReceiptIT.testAcknowledgeWithCustomMessageReceipt(PulsarCustomMessageReceiptIT.java:122)But
>  was 1 time:-> 
> at 
> org.apache.camel.component.pulsar.integration.PulsarCustomMessageReceiptIT$1.lambda$configure$0(PulsarCustomMessageReceiptIT.java:110)
> at 
> org.apache.camel.component.pulsar.integration.PulsarCustomMessageReceiptIT.testAcknowledgeWithCustomMessageReceipt(PulsarCustomMessageReceiptIT.java:122){noformat}
> and on re-run:
> {noformat}
> org.apache.pulsar.client.api.PulsarClientException$ProducerBusyException: 
> {"errorMsg":"org.apache.pulsar.broker.service.BrokerServiceException$NamingException:
>  Producer with name 'camel-producer-1' is already connected to topic 
> 'persistent://public/default/camel-topic-PulsarCustomMessageReceiptIT'","reqId":4293101970961248403,
>  "remote":"localhost/127.0.0.1:42031", "local":"/127.0.0.1:58882"}
> at 
> org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:1100)
> at 
> org.apache.pulsar.client.impl.ProducerBuilderImpl.create(ProducerBuilderImpl.java:89)at
>  
> org.apache.camel.component.pulsar.integration.PulsarCustomMessageReceiptIT.setup(PulsarCustomMessageReceiptIT.java:71)
>  {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to