Skip to content

Commit bbb28cd

Browse files
authored
Remove relative date in IndicesRequestCacheIT (#20920)
The dates in the test are starting to fall out of the now-10y window. It should be fine to use a fixed date for the 'from' since the 'to' uses now. Signed-off-by: Andrew Ross <andrross@amazon.com>
1 parent 9c29462 commit bbb28cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/internalClusterTest/java/org/opensearch/indices/IndicesRequestCacheIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ public void testCanCache() throws Exception {
552552
.setSize(0)
553553
.setRequestCache(true)
554554
.setQuery(QueryBuilders.rangeQuery("s").gte("2016-03-20").lte("2016-03-26"))
555-
.addAggregation(dateRange("foo").field("s").addRange("now-10y", "now"))
555+
.addAggregation(dateRange("foo").field("s").addRange("2016-01-01", "now"))
556556
.get();
557557
OpenSearchAssertions.assertAllSuccessful(r5);
558558
assertThat(r5.getHits().getTotalHits().value(), equalTo(7L));
@@ -575,7 +575,7 @@ public void testCanCache() throws Exception {
575575
.setSize(0)
576576
.setRequestCache(true)
577577
.setQuery(QueryBuilders.rangeQuery("s").gte("2016-03-20").lte("2016-03-26"))
578-
.addAggregation(filter("foo", QueryBuilders.rangeQuery("s").from("now-10y").to("now")))
578+
.addAggregation(filter("foo", QueryBuilders.rangeQuery("s").from("2016-01-01").to("now")))
579579
.get();
580580
OpenSearchAssertions.assertAllSuccessful(r4);
581581
assertThat(r4.getHits().getTotalHits().value(), equalTo(7L));

0 commit comments

Comments
 (0)