From e5592952288c1a1d7f883b5118569ac82864f51a Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 27 Jun 2014 09:16:51 +0200 Subject: [PATCH] [TEST] when the test fail, have the exception message as the reason the test failed but couldn't repro (yet), at the very least, make sure we have the exception message as the reason, can help to track down the failure itself when it happens again --- src/test/java/org/elasticsearch/script/IndexLookupTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/script/IndexLookupTests.java b/src/test/java/org/elasticsearch/script/IndexLookupTests.java index dc985589a50..d8d71f945fa 100644 --- a/src/test/java/org/elasticsearch/script/IndexLookupTests.java +++ b/src/test/java/org/elasticsearch/script/IndexLookupTests.java @@ -178,6 +178,7 @@ public class IndexLookupTests extends ElasticsearchIntegrationTest { client().prepareSearch("test").setQuery(QueryBuilders.matchAllQuery()).addScriptField("tvtest", script).execute().actionGet(); } catch (SearchPhaseExecutionException e) { assertThat( + "got: " + e.getDetailedMessage(), e.getDetailedMessage() .indexOf( "You must call get with all required flags! Instead of _index['int_payload_field'].get('b', _FREQUENCIES) and _index['int_payload_field'].get('b', _POSITIONS) call _index['int_payload_field'].get('b', _FREQUENCIES | _POSITIONS) once]; "), @@ -577,8 +578,8 @@ public class IndexLookupTests extends ElasticsearchIntegrationTest { Matchers.greaterThan(-1)); } } catch (SearchPhaseExecutionException ex) { - assertThat( + "got " + ex.getDetailedMessage(), ex.getDetailedMessage().indexOf("Cannot iterate twice! If you want to iterate more that once, add _CACHE explicitely."), Matchers.greaterThan(-1)); }