Skip to content

Commit a93aefb

Browse files
authored
Assume that rollover datemath tests run on the same day. (#34527)
in #28741 RolloverIT fails because we are cutting over to the next day while the test executes. We assume that this doesn't happen based on the assertions in the test. This adds a assumeTrue to ensure we are at least 5 min away form a date-flip. Closes #28741
1 parent 2cc3caf commit a93aefb

File tree

1 file changed

+1
-0
lines changed
  • server/src/test/java/org/elasticsearch/action/admin/indices/rollover

1 file changed

+1
-0
lines changed

server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ public void testRolloverOnExistingIndex() throws Exception {
274274

275275
public void testRolloverWithDateMath() {
276276
ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC);
277+
assumeTrue("only works on the same day", now.plusMinutes(5).getDayOfYear() == now.getDayOfYear());
277278
String index = "test-" + DateFormatters.forPattern("YYYY.MM.dd").format(now) + "-1";
278279
String dateMathExp = "<test-{now/d}-1>";
279280
assertAcked(prepareCreate(dateMathExp).addAlias(new Alias("test_alias")).get());

0 commit comments

Comments
 (0)