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

Guillaume Nodet commented on CAMEL-27771:
-----------------------------------------

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

Triage analysis confirmed the flakiness: the test clears mailboxes 
(Mailbox.clearAll) in the test method body, after the CamelContext and its POP3 
consumer routes have already started in @BeforeEach. The POP3 consumer has 
initialDelay=100ms, so on slow CI machines the first poll can fire before 
clearAll() executes, picking up stale messages from a previous test method. The 
fix is to move clearAll() before CamelContext starts (e.g. in setupResources()) 
and optionally add delete=true to the POP3 URIs.

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

> Fix flaky test MailMimeDecodeHeadersTest
> ----------------------------------------
>
>                 Key: CAMEL-27771
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27771
>             Project: Camel
>          Issue Type: Test
>          Components: camel-mail
>    Affects Versions: 4.24.0
>            Reporter: Aurélien Pupier
>            Assignee: Guillaume Nodet
>            Priority: Minor
>
> [1 failed 27 flaky in last 28 
> days|https://develocity.apache.org/scans/tests?search.relativeStartTime=P28D&search.timeZoneId=Europe%2FParis&tests.container=org.apache.camel.component.mail.MailMimeDecodeHeadersTest&tests.test=testLongMailSubject]
> {noformat}
> java.lang.AssertionError: mock://plain Received message count. Expected: <1> 
> but was: <3>     
>       at 
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:2079)    
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:2014)
>     
>       at 
> org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:502)
>       
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:480)
>         
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:470)
>         
>       at 
> org.apache.camel.component.mail.MailMimeDecodeHeadersTest.testLongMailSubject(MailMimeDecodeHeadersTest.java:68)
>      
> {noformat}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to