Wait for green status when index is created
This commit is contained in:
parent
263c5808bb
commit
5cf429d144
|
@ -123,6 +123,8 @@ public class MoreLikeThisActionTests extends AbstractSharedClusterTest {
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject().endObject().string();
|
.endObject().endObject().string();
|
||||||
client().admin().indices().prepareCreate("foo").addMapping("bar", mapping).execute().actionGet();
|
client().admin().indices().prepareCreate("foo").addMapping("bar", mapping).execute().actionGet();
|
||||||
|
ensureGreen();
|
||||||
|
|
||||||
client().prepareIndex("foo", "bar", "1")
|
client().prepareIndex("foo", "bar", "1")
|
||||||
.setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject())
|
.setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject())
|
||||||
.setRouting("2")
|
.setRouting("2")
|
||||||
|
@ -141,7 +143,7 @@ public class MoreLikeThisActionTests extends AbstractSharedClusterTest {
|
||||||
prepareCreate("foo", 2, ImmutableSettings.builder().put("index.number_of_replicas", 0)
|
prepareCreate("foo", 2, ImmutableSettings.builder().put("index.number_of_replicas", 0)
|
||||||
.put("index.number_of_shards", 2))
|
.put("index.number_of_shards", 2))
|
||||||
.execute().actionGet();
|
.execute().actionGet();
|
||||||
client().admin().cluster().prepareHealth("foo").setWaitForGreenStatus().execute().actionGet();
|
ensureGreen();
|
||||||
|
|
||||||
client().prepareIndex("foo", "bar", "1")
|
client().prepareIndex("foo", "bar", "1")
|
||||||
.setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject())
|
.setSource(jsonBuilder().startObject().startObject("foo").field("bar", "boz").endObject())
|
||||||
|
|
Loading…
Reference in New Issue