Marvel: Wait for shard allocation in IndexStatsCollectorTests

Original commit: elastic/x-pack-elasticsearch@f75c36f945
This commit is contained in:
Tanguy Leroux 2015-08-26 18:00:19 +02:00
parent 049ff4cc9f
commit 38061c5f98
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,8 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase {
client().admin().indices().prepareRefresh().get();
assertHitCount(client().prepareCount().get(), nbDocs);
waitForRelocation();
Collection<MarvelDoc> results = newIndexStatsCollector().doCollect();
assertThat(results, hasSize(1));
@ -88,6 +90,8 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase {
assertHitCount(client().prepareCount(indexPrefix + i).get(), docsPerIndex[i]);
}
waitForRelocation();
Collection<MarvelDoc> results = newIndexStatsCollector().doCollect();
assertThat(results, hasSize(nbIndices));