From ef7f5dc4355da67de9a23565ee289a73dfe286d9 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 28 May 2024 14:58:51 +0400 Subject: [PATCH] Fix tests without destructive_requires_names=false --- test_elasticsearch/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test_elasticsearch/utils.py b/test_elasticsearch/utils.py index f4f8cc885..abff98a55 100644 --- a/test_elasticsearch/utils.py +++ b/test_elasticsearch/utils.py @@ -215,10 +215,13 @@ def wipe_data_streams(client): def wipe_indices(client): - client.options(ignore_status=404).indices.delete( - index="*,-.ds-ilm-history-*", - expand_wildcards="all", - ) + indices = client.cat.indices().strip().splitlines() + if len(indices) > 0: + index_names = [i.split(" ")[2] for i in indices] + client.options(ignore_status=404).indices.delete( + index=",".join(index_names), + expand_wildcards="all", + ) def wipe_searchable_snapshot_indices(client):