Pārlūkot izejas kodu

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

Colin Goodheart-Smithe 11 gadi atpakaļ
vecāks
revīzija
76082182aa

+ 2 - 3
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