Skip to content

Commit f538b30

Browse files
authored
ensure no initializing shards during cluster cleanup (#39283) (#39480)
there are testing situations where newly created indices are being wiped before they are fully initialized. This results in an edge-case in the shard-locking strategy where an index cannot be deleted. This should fix that
1 parent 8b26f59 commit f538b30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ protected HttpHost buildHttpHost(String host, int port) {
292292
@After
293293
public final void cleanUpCluster() throws Exception {
294294
if (preserveClusterUponCompletion() == false) {
295+
ensureNoInitializingShards();
295296
wipeCluster();
296297
waitForClusterStateUpdatesToFinish();
297298
logIfThereAreRunningTasks();
@@ -806,7 +807,7 @@ protected static void ensureNoInitializingShards() throws IOException {
806807
request.addParameter("wait_for_no_initializing_shards", "true");
807808
request.addParameter("timeout", "70s");
808809
request.addParameter("level", "shards");
809-
client().performRequest(request);
810+
adminClient().performRequest(request);
810811
}
811812

812813
protected static void createIndex(String name, Settings settings) throws IOException {

0 commit comments

Comments
 (0)