From 76082182aa83777410bb5325c6eb6dfa491b5fd6 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Wed, 10 Sep 2014 17:15:19 +0100 Subject: [PATCH] [TEST] added more information to fail message for a test to debug test failure --- .../search/aggregations/bucket/StringTermsTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsTests.java b/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsTests.java index d60b8fffa3a..137181434b6 100644 --- a/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsTests.java +++ b/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsTests.java @@ -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