|
13 | 13 | import org.apache.logging.log4j.Logger; |
14 | 14 | import org.elasticsearch.ExceptionsHelper; |
15 | 15 | import org.elasticsearch.action.ActionListener; |
16 | | -import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; |
17 | 16 | import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; |
18 | 17 | import org.elasticsearch.action.admin.indices.template.delete.TransportDeleteComponentTemplateAction; |
19 | 18 | import org.elasticsearch.action.admin.indices.template.delete.TransportDeleteComposableIndexTemplateAction; |
|
30 | 29 | import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; |
31 | 30 | import org.elasticsearch.common.Strings; |
32 | 31 | import org.elasticsearch.common.io.stream.NamedWriteableRegistry; |
33 | | -import org.elasticsearch.core.TimeValue; |
34 | 32 | import org.elasticsearch.index.IndexNotFoundException; |
35 | 33 | import org.elasticsearch.indices.IndexTemplateMissingException; |
36 | 34 | import org.elasticsearch.repositories.RepositoryMissingException; |
|
45 | 43 |
|
46 | 44 | import static org.elasticsearch.test.ESTestCase.TEST_REQUEST_TIMEOUT; |
47 | 45 | import static org.elasticsearch.test.ESTestCase.safeAwait; |
48 | | -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout; |
49 | 46 |
|
50 | 47 | /** |
51 | 48 | * Base test cluster that exposes the basis to run tests against any elasticsearch cluster, whose layout |
@@ -73,24 +70,13 @@ public void beforeTest(Random randomGenerator) throws IOException, InterruptedEx |
73 | 70 | this.random = new Random(randomGenerator.nextLong()); |
74 | 71 | } |
75 | 72 |
|
76 | | - protected void ensureNoInitializingShards() { |
77 | | - logger.info("--> waiting for all initializing shards to complete within a reasonable time before wiping the cluster"); |
78 | | - assertNoTimeout( |
79 | | - client().admin() |
80 | | - .cluster() |
81 | | - .health(new ClusterHealthRequest(TimeValue.timeValueMinutes(1), "_all").waitForNoInitializingShards(true)) |
82 | | - .actionGet() |
83 | | - ); |
84 | | - } |
85 | | - |
86 | 73 | /** |
87 | 74 | * Wipes any data that a test can leave behind: indices, templates (except exclude templates) and repositories |
88 | 75 | */ |
89 | 76 | public void wipe(Set<String> excludeTemplates) { |
90 | 77 | if (size() == 0) { |
91 | 78 | return; |
92 | 79 | } |
93 | | - ensureNoInitializingShards(); |
94 | 80 | safeAwait((ActionListener<Void> done) -> { |
95 | 81 | try (RefCountingListener listeners = new RefCountingListener(done)) { |
96 | 82 | wipeAllTemplates(excludeTemplates, listeners); |
|
0 commit comments