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
This commit is contained in:
Tal Levy 2019-02-27 15:56:33 -08:00 committed by GitHub
parent 8b26f59958
commit f538b30af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -292,6 +292,7 @@ public abstract class ESRestTestCase extends ESTestCase {
@After
public final void cleanUpCluster() throws Exception {
if (preserveClusterUponCompletion() == false) {
ensureNoInitializingShards();
wipeCluster();
waitForClusterStateUpdatesToFinish();
logIfThereAreRunningTasks();
@ -806,7 +807,7 @@ public abstract class ESRestTestCase extends ESTestCase {
request.addParameter("wait_for_no_initializing_shards", "true");
request.addParameter("timeout", "70s");
request.addParameter("level", "shards");
client().performRequest(request);
adminClient().performRequest(request);
}
protected static void createIndex(String name, Settings settings) throws IOException {