You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2026/07/07 08:12:00 UTC

[jira] [Commented] (CAMEL-23926) Flaky test: ElasticsearchBulkIT due to shared index and NRT search gap

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

Guillaume Nodet commented on CAMEL-23926:
-----------------------------------------

Fixed via https://github.com/apache/camel/pull/24469 (merged).

> 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: Test
>          Components: camel-elasticsearch
>            Reporter: Guillaume Nodet
>            Priority: Major
>              Labels: tests
>             Fix For: 4.22.0
>
>
> 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)