diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java index e5170a90db9..3eac5a4a99a 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java @@ -134,8 +134,10 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { } public void testDeletedWhileQueued() throws Exception { - assertAcked(client().admin().indices().prepareCreate(".watches")); - + if (client().admin().indices().prepareExists(Watch.INDEX).get().isExists() == false) { + // we rarely create an .watches alias in the base class + assertAcked(client().admin().indices().prepareCreate(Watch.INDEX)); + } DateTime now = DateTime.now(UTC); Wid wid = new Wid("_id", 1, now); ScheduleTriggerEvent event = new ScheduleTriggerEvent("_id", now, now); @@ -314,8 +316,10 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase { // Watcher could prevent to start if a watch record tried to executed twice or more and the watch didn't exist // for that watch record or the execution threadpool rejected the watch record. // A watch record without a watch is the easiest to simulate, so that is what this test does. - assertAcked(client().admin().indices().prepareCreate(Watch.INDEX)); - + if (client().admin().indices().prepareExists(Watch.INDEX).get().isExists() == false) { + // we rarely create an .watches alias in the base class + assertAcked(client().admin().indices().prepareCreate(Watch.INDEX)); + } DateTime triggeredTime = new DateTime(2015, 11, 5, 0, 0, 0, 0, DateTimeZone.UTC); final String watchRecordIndex = HistoryStore.getHistoryIndexNameForTime(triggeredTime);