From 14b09cf24abbabfeaa27e5876d4c552434756585 Mon Sep 17 00:00:00 2001 From: Dimitris Rempapis Date: Sat, 25 Jul 2026 08:54:18 +0300 Subject: [PATCH] Fix flaky AsyncSearchErrorTraceIT shard lock failure (#154952) (cherry picked from commit 1bf9791d9320bbaabb4fdadffb506571be4d239c) --- .../xpack/search/AsyncSearchErrorTraceIT.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchErrorTraceIT.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchErrorTraceIT.java index e5be163e2c289..263baf1426a49 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchErrorTraceIT.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchErrorTraceIT.java @@ -281,12 +281,8 @@ private void deleteAsyncSearchIfPresent(Map map) throws IOExcept return; } - // Make sure the .async-search system index is green before deleting it - try { - ensureGreen(".async-search"); - } catch (Exception ignore) { - // the index may not exist - } + awaitIndexExists(".async-search"); + ensureGreen(".async-search"); Response response = getRestClient().performRequest(new Request("DELETE", "/_async_search/" + id)); HttpEntity entity = response.getEntity();