Assert on index delete in tests to ensure all indices are wiped even on disk

This commit is contained in:
Simon Willnauer 2013-08-07 17:56:55 +02:00
parent bcda6dfe54
commit 6c91ff83f2
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
import org.elasticsearch.action.admin.indices.optimize.OptimizeResponse;
@ -143,7 +144,8 @@ public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase {
public static void wipeIndices(String... names) {
try {
client().admin().indices().prepareDelete(names).execute().actionGet();
final DeleteIndexResponse actionGet = client().admin().indices().prepareDelete(names).execute().actionGet();
assertThat("Delete Index failed - not acked", actionGet.isAcknowledged(), equalTo(true));
} catch (IndexMissingException e) {
// ignore
}