From 5cf429d144ce01378a47327a92e73317b6cc1738 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 2 Aug 2013 20:56:54 +0200 Subject: [PATCH] Wait for green status when index is created --- .../test/integration/mlt/MoreLikeThisActionTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/test/integration/mlt/MoreLikeThisActionTests.java b/src/test/java/org/elasticsearch/test/integration/mlt/MoreLikeThisActionTests.java index 8fa250acde1..6f72a20aea5 100644 --- a/src/test/java/org/elasticsearch/test/integration/mlt/MoreLikeThisActionTests.java +++ b/src/test/java/org/elasticsearch/test/integration/mlt/MoreLikeThisActionTests.java @@ -123,6 +123,8 @@ public class MoreLikeThisActionTests extends AbstractSharedClusterTest { .endObject() .endObject().endObject().string(); client().admin().indices().prepareCreate("foo").addMapping("bar", mapping).execute().actionGet(); + ensureGreen(); + client().prepareIndex("foo", "bar", "1") .setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject()) .setRouting("2") @@ -141,7 +143,7 @@ public class MoreLikeThisActionTests extends AbstractSharedClusterTest { prepareCreate("foo", 2, ImmutableSettings.builder().put("index.number_of_replicas", 0) .put("index.number_of_shards", 2)) .execute().actionGet(); - client().admin().cluster().prepareHealth("foo").setWaitForGreenStatus().execute().actionGet(); + ensureGreen(); client().prepareIndex("foo", "bar", "1") .setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject())