[TEST] added more information to fail message for a test to debug test failure

This commit is contained in:
Colin Goodheart-Smithe 2014-09-10 17:15:19 +01:00
parent dbfac659f9
commit 76082182aa
1 changed files with 2 additions and 3 deletions

View File

@ -1152,7 +1152,7 @@ public class StringTermsTests extends ElasticsearchIntegrationTest {
@Test
public void singleValuedField_OrderedByMultiValuedSubAggregation_WithUknownMetric() throws Exception {
try {
client().prepareSearch("idx").setTypes("type")
SearchResponse response = client().prepareSearch("idx").setTypes("type")
.addAggregation(terms("terms")
.executionHint(randomExecutionHint())
.field(SINGLE_VALUED_FIELD_NAME)
@ -1160,9 +1160,8 @@ public class StringTermsTests extends ElasticsearchIntegrationTest {
.order(Terms.Order.aggregation("stats.foo", true))
.subAggregation(stats("stats").field("i"))
).execute().actionGet();
fail("Expected search to fail when trying to sort terms aggregation by multi-valued sug-aggregation " +
"with an unknown specified metric to order by");
"with an unknown specified metric to order by. response had " + response.getFailedShards() + " failed shards.");
} catch (ElasticsearchException e) {
// expected