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

Guillaume Nodet commented on CAMEL-24618:
-----------------------------------------

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

Preliminary analysis confirms the flakiness root cause:

1. The FTP consumer endpoint has no delete/noop/idempotent option, so files 
accumulate on the FTP server across test retries.
2. FtpServiceExtension.afterAll() is a no-op ("Restart not supported"), so the 
FTP server and its directories are never reset between runs.
3. The initialDelay=2000ms + default resultWaitTime can cause timing races on 
slow CI.

These two issues explain both observed failure patterns: Expected <1> but was 
<0> (timing race) and Expected <1> but was <9> (accumulated files from retries).

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

> Fix flaky test 
> SpringFileAntPathMatcherRemoteFileFilterTest.testAntPatchMatcherFilter
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24618
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24618
>             Project: Camel
>          Issue Type: Test
>          Components: camel-ftp
>    Affects Versions: 4.23.0
>            Reporter: Aurélien Pupier
>            Assignee: Guillaume Nodet
>            Priority: Minor
>
> it failed 13 times in last 90 days
> when it is is failig, it is failing 3 times in a row. it has never been "only 
> flaky"
> https://develocity.apache.org/scans/tests?search.relativeStartTime=P90D&search.rootProjectNames=camel&search.timeZoneId=Europe%2FParis&tests.container=org.apache.camel.itest.ftp.SpringFileAntPathMatcherRemoteFileFilterTest&tests.test=testAntPatchMatherFilter
> first error is usually:
> {noformat}
> java.lang.AssertionError: mock://result Received message count. Expected: <1> 
> but was: <0>    
>       at 
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:2075)    
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:2010)
>     
>       at 
> org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:498)
>       
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:476)
>         
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:466)
>         
>       at 
> org.apache.camel.itest.ftp.SpringFileAntPathMatcherRemoteFileFilterTest.testAntPatchMatherFilter(SpringFileAntPathMatcherRemoteFileFilterTest.java:66)
>        
> {noformat}
> and next errors on retry, are smething like:
> {noformat}
> java.lang.AssertionError: mock://result Received message count. Expected: <1> 
> but was: <9>    
>       at 
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:2075)    
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:2010)
>     
>       at 
> org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:498)
>       
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:476)
>         
>       at 
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:466)
>         
>       at 
> org.apache.camel.itest.ftp.SpringFileAntPathMatcherRemoteFileFilterTest.testAntPatchMatherFilter(SpringFileAntPathMatcherRemoteFileFilterTest.java:66)
>        
> {noformat}



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

Reply via email to