From a93aefb4a43b03dfc3d31d140725f78d6484cc69 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 16 Oct 2018 20:22:32 +0200 Subject: [PATCH] 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 --- .../elasticsearch/action/admin/indices/rollover/RolloverIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java index 7823cd8849c..c75d8bb054f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java @@ -274,6 +274,7 @@ public class RolloverIT extends ESIntegTestCase { 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 = ""; assertAcked(prepareCreate(dateMathExp).addAlias(new Alias("test_alias")).get());