[TEST] Fix OldMonitoringIndicesBackwardsCompatibilityTests

OldMonitoringIndicesBackwardsCompatibilityTests fails because it waits for more shards stats to be collected but that can only work if new indices are created in the meanwhile.

Original commit: elastic/x-pack-elasticsearch@003c28cf93
This commit is contained in:
Tanguy Leroux 2016-11-23 15:16:22 +01:00
parent b503f05916
commit 52eb621309
1 changed files with 5 additions and 1 deletions

View File

@ -145,6 +145,10 @@ public class OldMonitoringIndicesBackwardsCompatibilityTests extends AbstractOld
Arrays.stream(firstNode.getHits().hits()).forEach(hit -> checkNodeStats(version, masterNodeId, hit.sourceAsMap()));
Arrays.stream(firstState.getHits().hits()).forEach(hit -> checkClusterState(version, hit.sourceAsMap()));
// Create some docs
indexRandom(true, client().prepareIndex("test-1", "doc", "1").setSource("field", 1),
client().prepareIndex("test-2", "doc", "2").setSource("field", 2));
// Wait for monitoring to accumulate some data about the current cluster
long indexStatsCount = firstIndexStats.getHits().totalHits();
assertBusy(() -> search(new IndexStatsResolver(MonitoredSystem.ES, Settings.EMPTY),
@ -170,7 +174,7 @@ public class OldMonitoringIndicesBackwardsCompatibilityTests extends AbstractOld
}
assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(settings).get());
CountDown retries = new CountDown(5);
CountDown retries = new CountDown(10);
assertBusy(() -> {
String[] indices = new String[]{".marvel-*", ".monitoring-*"};
IndicesExistsResponse existsResponse = client().admin().indices().prepareExists(indices).get();