Tests: Add more logging to SearchPreferenceTests so that we can know which preference is failing.

This commit is contained in:
Adrien Grand 2015-08-03 12:55:15 +02:00
parent ade3881152
commit 365a324fc5
1 changed files with 1 additions and 0 deletions

View File

@ -49,6 +49,7 @@ public class SearchPreferenceTests extends ElasticsearchIntegrationTest {
client().admin().cluster().prepareHealth().setWaitForStatus(ClusterHealthStatus.RED).execute().actionGet();
String[] preferences = new String[] {"_primary", "_local", "_primary_first", "_prefer_node:somenode", "_prefer_node:server2"};
for (String pref : preferences) {
logger.info("--> Testing out preference={}", pref);
SearchResponse searchResponse = client().prepareSearch().setSize(0).setPreference(pref).execute().actionGet();
assertThat(RestStatus.OK, equalTo(searchResponse.status()));
assertThat(pref, searchResponse.getFailedShards(), greaterThanOrEqualTo(0));