[TEST] Make sure there are shards started so that `ESIntegTestCase#assertSameDocIdsOnShards()` does not fail with shard not found.

This commit is contained in:
Martijn van Groningen 2018-10-15 10:24:28 +02:00
parent 74dc2da873
commit 51eca14288
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 4 additions and 2 deletions

View File

@ -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());