[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
This commit is contained in:
parent
f7da6da73a
commit
e559295228
|
@ -178,6 +178,7 @@ public class IndexLookupTests extends ElasticsearchIntegrationTest {
|
||||||
client().prepareSearch("test").setQuery(QueryBuilders.matchAllQuery()).addScriptField("tvtest", script).execute().actionGet();
|
client().prepareSearch("test").setQuery(QueryBuilders.matchAllQuery()).addScriptField("tvtest", script).execute().actionGet();
|
||||||
} catch (SearchPhaseExecutionException e) {
|
} catch (SearchPhaseExecutionException e) {
|
||||||
assertThat(
|
assertThat(
|
||||||
|
"got: " + e.getDetailedMessage(),
|
||||||
e.getDetailedMessage()
|
e.getDetailedMessage()
|
||||||
.indexOf(
|
.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]; "),
|
"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));
|
Matchers.greaterThan(-1));
|
||||||
}
|
}
|
||||||
} catch (SearchPhaseExecutionException ex) {
|
} catch (SearchPhaseExecutionException ex) {
|
||||||
|
|
||||||
assertThat(
|
assertThat(
|
||||||
|
"got " + ex.getDetailedMessage(),
|
||||||
ex.getDetailedMessage().indexOf("Cannot iterate twice! If you want to iterate more that once, add _CACHE explicitely."),
|
ex.getDetailedMessage().indexOf("Cannot iterate twice! If you want to iterate more that once, add _CACHE explicitely."),
|
||||||
Matchers.greaterThan(-1));
|
Matchers.greaterThan(-1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue