Skip to content

Commit

Permalink
Assume that rollover datemath tests run on the same day. (elastic#34527)
Browse files Browse the repository at this point in the history
in elastic#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 elastic#28741
  • Loading branch information
s1monw authored Oct 16, 2018
1 parent 2cc3caf commit a93aefb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public void testRolloverOnExistingIndex() throws Exception {

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

0 comments on commit a93aefb

Please sign in to comment.