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

Guillaume Nodet commented on CAMEL-24905:
-----------------------------------------

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

Triage confirmed two root causes for the flakiness:
1. tearDownMongo() only cleans the base GridFS bucket but not the -a, -pts, and 
customFileFilterTest buckets, leaving leftover files that cause the assertFalse 
pre-condition check to fail.
2. All four consumer routes in createRouteBuilder() send to the same mock:test 
endpoint, so messages from unrelated routes pollute the expected message count.
Fix scope: single PR - use separate mock endpoints per consumer route and clean 
all buckets in setup/teardown.

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

> Fix flaky test GridFsConsumerIT.testAttribute
> ---------------------------------------------
>
>                 Key: CAMEL-24905
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24905
>             Project: Camel
>          Issue Type: Test
>          Components: camel-mongodb-gridfs
>    Affects Versions: 4.23.0
>            Reporter: Aurélien Pupier
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> the test failed 2 times in the last 3 days.
> it was flaky 10 times in the last 90 days
> https://develocity.apache.org/scans/tests?search.relativeStartTime=P90D&search.rootProjectNames=camel&search.tags=main&search.timeZoneId=Europe%2FParis&tests.container=org.apache.camel.component.mongodb.gridfs.integration.GridFsConsumerIT&tests.test=testAttribute
> first failure:
> {noformat}
> java.lang.AssertionError: mock://test Received message count. Expected: <1> 
> but was: <2>      
>       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.component.mongodb.gridfs.integration.GridFsConsumerIT.runTest(GridFsConsumerIT.java:123)
>     
>       at 
> org.apache.camel.component.mongodb.gridfs.integration.GridFsConsumerIT.testAttribute(GridFsConsumerIT.java:72)
>        
> {noformat}
> second failure on re-run:
> {noformat}
> org.opentest4j.AssertionFailedError: expected: <false> but was: <true>        
>       at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:257)    
>       at 
> org.apache.camel.component.mongodb.gridfs.integration.GridFsConsumerIT.runTest(GridFsConsumerIT.java:117)
>     
>       at 
> org.apache.camel.component.mongodb.gridfs.integration.GridFsConsumerIT.testAttribute(GridFsConsumerIT.java:72)
>        
> {noformat}



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

Reply via email to