Skip to content

Commit 43d62b4

Browse files
revert TestCluster changes
waiting for all shards to complete is not feasible due to random indices
1 parent 3fd7f4c commit 43d62b4

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

test/framework/src/main/java/org/elasticsearch/test/TestCluster.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.apache.logging.log4j.Logger;
1414
import org.elasticsearch.ExceptionsHelper;
1515
import org.elasticsearch.action.ActionListener;
16-
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
1716
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
1817
import org.elasticsearch.action.admin.indices.template.delete.TransportDeleteComponentTemplateAction;
1918
import org.elasticsearch.action.admin.indices.template.delete.TransportDeleteComposableIndexTemplateAction;
@@ -30,7 +29,6 @@
3029
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
3130
import org.elasticsearch.common.Strings;
3231
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
33-
import org.elasticsearch.core.TimeValue;
3432
import org.elasticsearch.index.IndexNotFoundException;
3533
import org.elasticsearch.indices.IndexTemplateMissingException;
3634
import org.elasticsearch.repositories.RepositoryMissingException;
@@ -45,7 +43,6 @@
4543

4644
import static org.elasticsearch.test.ESTestCase.TEST_REQUEST_TIMEOUT;
4745
import static org.elasticsearch.test.ESTestCase.safeAwait;
48-
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout;
4946

5047
/**
5148
* 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
7370
this.random = new Random(randomGenerator.nextLong());
7471
}
7572

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-
8673
/**
8774
* Wipes any data that a test can leave behind: indices, templates (except exclude templates) and repositories
8875
*/
8976
public void wipe(Set<String> excludeTemplates) {
9077
if (size() == 0) {
9178
return;
9279
}
93-
ensureNoInitializingShards();
9480
safeAwait((ActionListener<Void> done) -> {
9581
try (RefCountingListener listeners = new RefCountingListener(done)) {
9682
wipeAllTemplates(excludeTemplates, listeners);

0 commit comments

Comments
 (0)