gnodet opened a new pull request, #26787: URL: https://github.com/apache/camel/pull/26787
## Summary Fixes two independent root causes that together make `GridFsConsumerIT` flaky when tests run in sequence sharing the same MongoDB container. ## Root Causes ### 1. Incomplete bucket cleanup in `tearDownMongo()` `AbstractMongoDbITSupport.tearDownMongo()` only cleaned the _base_ GridFS bucket (`GridFsConsumerIT`). The `-a`, `-pts`, and `customFileFilterTest` buckets used by the three other consumer routes were never cleaned between tests. When `testAttribute()` ran after `testTimestamp()`, the `-a` bucket still contained files from prior runs, causing the `assertFalse(gridfs.find(...).cursor().hasNext())` pre-condition on line 117 to fail. **Fix:** `tearDownMongo()` now drops all four buckets via a shared `dropBucket()` helper. ### 2. All consumer routes share `mock:test` — cross-route message pollution All four GridFS consumer routes in `createRouteBuilder()` sent to the same `mock:test` endpoint. When a test uploaded a file to bucket `-a`, the `-a` consumer delivered the message to `mock:test`. But if any _other_ consumer route happened to pick up a leftover file from a previous test (before cleanup ran), it also delivered to `mock:test`, making the received message count higher than expected — `Expected <1> but was <2>`. **Fix:** Each consumer route now uses a dedicated mock endpoint (`mock:test-ts`, `mock:test-a`, `mock:test-pts`, `mock:test-custom`). Each test method asserts only on its own mock, so unrelated consumers cannot interfere. ## Additional Changes - Drop `public` from test class and methods (JUnit 5 / Camel convention: package-private is preferred). ## Testing - Compilation verified locally (`mvn test-compile`). - Changes are test-only; CI will run the full integration test suite against a live MongoDB container. --- _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_ -- 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]
