Guillaume Nodet created CAMEL-23926:
---------------------------------------

             Summary: Flaky test: ElasticsearchBulkIT due to shared index and 
NRT search gap
                 Key: CAMEL-23926
                 URL: https://issues.apache.org/jira/browse/CAMEL-23926
             Project: Camel
          Issue Type: Bug
          Components: camel-elasticsearch
            Reporter: Guillaume Nodet
            Assignee: Aurélien Pupier


ElasticsearchBulkIT is 48% flaky (47/98 runs fail) per the Develocity dashboard.

Develocity: 
https://develocity.apache.org/scans/tests?search.rootProjectNames=camel&tests.sortField=FLAKY

Root cause:
1. Shared mutable index: All Elasticsearch IT classes share a hardcoded 
'twitter' index name. ElasticsearchIndexIT explicitly deletes this index during 
its tests, causing interference when tests run in parallel or in certain orders.
2. Near-real-time (NRT) search gap: Elasticsearch does not make documents 
searchable immediately after indexing. Tests that write and immediately search 
may not find the data.

Fix:
- Use unique index names per test class (e.g. bulk, idx, get-search, cluster)
- Add Awaitility for write-then-search patterns (following 
ElasticsearchSizeLimitIT pattern)



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

Reply via email to