[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:
parent
b503f05916
commit
52eb621309
|
@ -145,6 +145,10 @@ public class OldMonitoringIndicesBackwardsCompatibilityTests extends AbstractOld
|
||||||
Arrays.stream(firstNode.getHits().hits()).forEach(hit -> checkNodeStats(version, masterNodeId, hit.sourceAsMap()));
|
Arrays.stream(firstNode.getHits().hits()).forEach(hit -> checkNodeStats(version, masterNodeId, hit.sourceAsMap()));
|
||||||
Arrays.stream(firstState.getHits().hits()).forEach(hit -> checkClusterState(version, 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
|
// Wait for monitoring to accumulate some data about the current cluster
|
||||||
long indexStatsCount = firstIndexStats.getHits().totalHits();
|
long indexStatsCount = firstIndexStats.getHits().totalHits();
|
||||||
assertBusy(() -> search(new IndexStatsResolver(MonitoredSystem.ES, Settings.EMPTY),
|
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());
|
assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(settings).get());
|
||||||
|
|
||||||
CountDown retries = new CountDown(5);
|
CountDown retries = new CountDown(10);
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
String[] indices = new String[]{".marvel-*", ".monitoring-*"};
|
String[] indices = new String[]{".marvel-*", ".monitoring-*"};
|
||||||
IndicesExistsResponse existsResponse = client().admin().indices().prepareExists(indices).get();
|
IndicesExistsResponse existsResponse = client().admin().indices().prepareExists(indices).get();
|
||||||
|
|
Loading…
Reference in New Issue