[Test] Ensure monitoring indices are yellow in LocalExporterTests

Before searching for documents in monitoring indices, we need to ensure
that they exist and are available.

Original commit: elastic/x-pack-elasticsearch@29db55a1fe
This commit is contained in:
Tanguy Leroux 2017-05-10 09:41:28 +02:00
parent 85deb1f8f7
commit f3b3df0911
1 changed files with 3 additions and 0 deletions

View File

@ -195,6 +195,9 @@ public class LocalExporterTests extends MonitoringIntegTestCase {
assertEquals(RestStatus.OK, bulk.get().status());
refresh();
assertThat(client().admin().indices().prepareExists(".monitoring-*").get().isExists(), is(true));
ensureYellow(".monitoring-*");
SearchResponse response = client().prepareSearch(".monitoring-*").get();
assertEquals(nbDocs, response.getHits().getTotalHits());
});