From 51eca14288ec76a6533dca5ed5dedd5cffedf33b Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 15 Oct 2018 10:24:28 +0200 Subject: [PATCH] [TEST] Make sure there are shards started so that `ESIntegTestCase#assertSameDocIdsOnShards()` does not fail with shard not found. --- .../java/org/elasticsearch/xpack/ccr/ShardChangesIT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/ShardChangesIT.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/ShardChangesIT.java index 134c4a31415..6a4b6191666 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/ShardChangesIT.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/ShardChangesIT.java @@ -468,8 +468,10 @@ public class ShardChangesIT extends ESIntegTestCase { } public void testFollowNonExistentIndex() throws Exception { - assertAcked(client().admin().indices().prepareCreate("test-leader").get()); - assertAcked(client().admin().indices().prepareCreate("test-follower").get()); + String indexSettings = getIndexSettings(1, 0, Collections.emptyMap()); + assertAcked(client().admin().indices().prepareCreate("test-leader").setSource(indexSettings, XContentType.JSON).get()); + assertAcked(client().admin().indices().prepareCreate("test-follower").setSource(indexSettings, XContentType.JSON).get()); + ensureGreen("test-leader", "test-follower"); // Leader index does not exist. ResumeFollowAction.Request followRequest1 = resumeFollow("non-existent-leader", "test-follower"); expectThrows(IndexNotFoundException.class, () -> client().execute(ResumeFollowAction.INSTANCE, followRequest1).actionGet());