Wait for metadata to stabilize before checking for it after opening indices in testMetaWrittenWhenIndexIsClosedAndMetaUpdated

This commit is contained in:
Boaz Leskes 2016-03-22 11:36:42 +01:00
parent 33521fc27c
commit b07a8185a7
1 changed files with 2 additions and 0 deletions

View File

@ -142,6 +142,8 @@ public class MetaDataWriteDataNodesIT extends ESIntegTestCase {
// finally check that meta data is also written of index opened again
assertAcked(client().admin().indices().prepareOpen(index).get());
// make sure index is fully initialized and nothing is changed anymore
ensureGreen();
indicesMetaData = getIndicesMetaDataOnNode(dataNode);
assertThat(indicesMetaData.get(index).getState(), equalTo(IndexMetaData.State.OPEN));
}