[TEST] wait for pending tasks finished before testing cluster state collector

Original commit: elastic/x-pack-elasticsearch@d42c8c4bbe
This commit is contained in:
Britta Weber 2016-09-09 12:05:23 +02:00
parent 6ca086b997
commit 4bf685cd31
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ import static org.hamcrest.Matchers.notNullValue;
public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
public void testClusterStateCollectorNoIndices() throws Exception {
// waits for pending tasks before collecing cluster state.
// prevents the collector to read an older cluster state than the one used in assert later
ensureGreen();
assertMonitoringDocs(newClusterStateCollector().doCollect(), 0);
}