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();