From 784e40ac6c353337a044eac9c29ef1e94183894a Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 3 Nov 2016 17:22:02 -0400 Subject: [PATCH] Slow down monitoring bwc test so it can shut down We only need it to be so fast when starting up. We can slow it down once it has started so shutdown isn't problematic. Original commit: elastic/x-pack-elasticsearch@052d64402fa4a973870b655b7dabda00c2d567c0 --- .../OldMonitoringIndicesBackwardsCompatibilityIT.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/OldMonitoringIndicesBackwardsCompatibilityIT.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/OldMonitoringIndicesBackwardsCompatibilityIT.java index 15d70592fba..49d15f22f7b 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/OldMonitoringIndicesBackwardsCompatibilityIT.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/monitoring/OldMonitoringIndicesBackwardsCompatibilityIT.java @@ -34,6 +34,8 @@ import java.util.Set; import java.util.concurrent.TimeUnit; import static org.elasticsearch.common.unit.TimeValue.timeValueMillis; +import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.greaterThan; @@ -106,6 +108,11 @@ public class OldMonitoringIndicesBackwardsCompatibilityIT extends AbstractOldXPa IndexStatsResolver resolver = new IndexStatsResolver(MonitoredSystem.ES, Settings.EMPTY); logger.info("--> {} Waiting for [{}]", Thread.currentThread().getName(), resolver.indexPattern()); assertBusy(() -> assertTrue(client().admin().indices().prepareExists(resolver.indexPattern()).get().isExists())); + // Slow down monitoring from its previously super fast pace so we can shut down without trouble + Settings.Builder settings = Settings.builder() + .put(MonitoringSettings.INTERVAL.getKey(), timeValueSeconds(10).getStringRep()); + assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(settings).get()); + SearchResponse firstIndexStats = search(resolver, greaterThanOrEqualTo(10L)); // All the other aliases should have been created by now so we can assert that we have the data we saved in the bwc indexes