From 62da59f76fcf9484f736520bc0fe3fc9d20ba763 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 16 Jul 2014 13:48:39 +0200 Subject: [PATCH] [TEST] Verify if clear cache request went to all shards. --- .../search/child/SimpleChildQuerySearchTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/search/child/SimpleChildQuerySearchTests.java b/src/test/java/org/elasticsearch/search/child/SimpleChildQuerySearchTests.java index 99bac148f8a..5923fb8e580 100644 --- a/src/test/java/org/elasticsearch/search/child/SimpleChildQuerySearchTests.java +++ b/src/test/java/org/elasticsearch/search/child/SimpleChildQuerySearchTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.search.child; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchIllegalArgumentException; +import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; @@ -333,7 +334,9 @@ public class SimpleChildQuerySearchTests extends ElasticsearchIntegrationTest { assertThat(indicesStatsResponse.getTotal().getIdCache().getMemorySizeInBytes(), greaterThan(0l)); assertThat(indicesStatsResponse.getTotal().getFieldData().getMemorySizeInBytes(), equalTo(0l)); - client().admin().indices().prepareClearCache("test").setIdCache(true).get(); + ClearIndicesCacheResponse clearCacheResponse = client().admin().indices().prepareClearCache("test").setIdCache(true).get(); + assertNoFailures(clearCacheResponse); + assertAllSuccessful(clearCacheResponse); indicesStatsResponse = client().admin().indices() .prepareStats("test").setFieldData(true).get(); assertThat(indicesStatsResponse.getTotal().getIdCache().getMemorySizeInBytes(), equalTo(0l));