[TEST] fixed SimpleQueryTests#testDateRangeInQueryString to specify the mappings upfront and wait for green

This commit is contained in:
javanna 2014-03-10 16:22:21 +01:00 committed by Luca Cavanna
parent af4c112907
commit 045e43163f
2 changed files with 13 additions and 4 deletions

View File

@ -178,10 +178,15 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
assertHitCount(countResponse, 0l);
}
@Test
@Test //https://github.com/elasticsearch/elasticsearch/issues/3540
public void testDateRangeInQueryString() {
createIndex("test");
//the mapping needs to be provided upfront otherwise we are not sure how many failures we get back
//as with dynamic mappings some shards might be lacking behind and parse a different query
assertAcked(prepareCreate("test").addMapping(
"type", "past", "type=date", "future", "type=date"
));
ensureGreen();
NumShards test = getNumShards("test");
String aMonthAgo = ISODateTimeFormat.yearMonthDay().print(new DateTime(DateTimeZone.UTC).minusMonths(1));

View File

@ -428,9 +428,13 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
assertHitCount(searchResponse, 0l);
}
@Test
@Test //https://github.com/elasticsearch/elasticsearch/issues/3540
public void testDateRangeInQueryString() {
createIndex("test");
//the mapping needs to be provided upfront otherwise we are not sure how many failures we get back
//as with dynamic mappings some shards might be lacking behind and parse a different query
assertAcked(prepareCreate("test").addMapping(
"type", "past", "type=date", "future", "type=date"
));
ensureGreen();
String aMonthAgo = ISODateTimeFormat.yearMonthDay().print(new DateTime(DateTimeZone.UTC).minusMonths(1));