Backport of #38903 When tearing down from `ESSingleNodeTestCase` we perform a delete on "*" indices, it some cases, however, those indices are not fully deleted. Rather than have a failure occur later down the change (see: https://github.com/elastic/elasticsearch/issues/30290#issuecomment-463589008 ) the failure should occurr immediately so it can be diagnosed more easily.
This commit is contained in:
parent
00cb8d0be8
commit
7d449c5f65
|
@ -30,6 +30,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
|||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.util.BigArrays;
|
||||
|
@ -127,6 +128,9 @@ public abstract class ESSingleNodeTestCase extends ESTestCase {
|
|||
metaData.persistentSettings().size(), equalTo(0));
|
||||
assertThat("test leaves transient cluster metadata behind: " + metaData.transientSettings().keySet(),
|
||||
metaData.transientSettings().size(), equalTo(0));
|
||||
GetIndexResponse indices = client().admin().indices().prepareGetIndex().addIndices("*").get();
|
||||
assertThat("test leaves indices that were not deleted: " + Strings.arrayToCommaDelimitedString(indices.indices()),
|
||||
indices.indices(), equalTo(Strings.EMPTY_ARRAY));
|
||||
if (resetNodeAfterTest()) {
|
||||
assert NODE != null;
|
||||
stopNode();
|
||||
|
|
Loading…
Reference in New Issue