try and wait better for all mapping updates to be processes in test

This commit is contained in:
Shay Banon 2013-12-12 15:06:37 +01:00
parent 198d36dc15
commit f0e1f9215b

View File

@ -78,6 +78,7 @@ public class UpdateMappingTests extends ElasticsearchIntegrationTest {
String fieldName = "field_" + type + "_" + rec;
fieldName = "\"" + fieldName + "\""; // quote it, so we make sure we catch the exact one
if (!typeToSource.containsKey(type) || !typeToSource.get(type).contains(fieldName)) {
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).execute().actionGet();
awaitBusy(new Predicate<Object>() {
@Override
public boolean apply(Object input) {
@ -85,6 +86,7 @@ public class UpdateMappingTests extends ElasticsearchIntegrationTest {
return pendingTasks.pendingTasks().isEmpty();
}
});
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).execute().actionGet();
// its going to break, before we do, make sure that the cluster state hasn't changed on us...
ClusterState state2 = client().admin().cluster().prepareState().get().getState();
if (state.version() != state2.version()) {