Browse Source

Fix test with dates

Low numbers of milliseconds since epoch were being interpretted as a
year...........
Nik Everett 5 years ago
parent
commit
b0b2acc8c5

+ 2 - 2
server/src/test/java/org/elasticsearch/search/aggregations/support/CoreValuesSourceTypeTests.java

@@ -68,7 +68,7 @@ public class CoreValuesSourceTypeTests extends MapperServiceTestCase {
     }
 
     public void testDatePrepareRoundingWithQuery() throws IOException {
-        long min = randomLongBetween(0, 1000000);
+        long min = randomLongBetween(100000, 1000000);   // The minimum has to be fairly large or we might accidentally think its a year....
         long max = randomLongBetween(min + 10, 100000000000L);
         MapperService mapperService = dateMapperService();
         Query query = mapperService.fieldType("field")
@@ -81,7 +81,7 @@ public class CoreValuesSourceTypeTests extends MapperServiceTestCase {
     }
 
     public void testDatePrepareRoundingWithDocAndQuery() throws IOException {
-        long min = randomLongBetween(0, 1000000);
+        long min = randomLongBetween(100000, 1000000); // The minimum has to be fairly large or we might accidentally think its a year....
         long minQuery, minDocs;
         if (randomBoolean()) {
             minQuery = min;