From 38061c5f9831a0a0c8263a46da8a3ec38e766e5b Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 26 Aug 2015 18:00:19 +0200 Subject: [PATCH] Marvel: Wait for shard allocation in IndexStatsCollectorTests Original commit: elastic/x-pack-elasticsearch@f75c36f945de4d9078c6a01a24fe28cac0e7ea67 --- .../agent/collector/indices/IndexStatsCollectorTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java index 6361b6af574..b13ca2ecffb 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java @@ -43,6 +43,8 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase { client().admin().indices().prepareRefresh().get(); assertHitCount(client().prepareCount().get(), nbDocs); + waitForRelocation(); + Collection 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 results = newIndexStatsCollector().doCollect(); assertThat(results, hasSize(nbIndices));