From c3d207f437f3f0d1d10b7946434dd95905aa13e6 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Tue, 7 Jan 2020 10:08:13 -0500 Subject: [PATCH] Disable auto refresh in testSegmentsStats (#50689) If an auto-refresh happens, then version_map_memory is reset to 0. By default, the auto-refresh occurs for every second in the first 30 seconds until search becomes idle. Closes #50362 --- .../java/org/elasticsearch/indices/stats/IndexStatsIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/indices/stats/IndexStatsIT.java b/server/src/test/java/org/elasticsearch/indices/stats/IndexStatsIT.java index 3b569b614af..5d8c46e61d6 100644 --- a/server/src/test/java/org/elasticsearch/indices/stats/IndexStatsIT.java +++ b/server/src/test/java/org/elasticsearch/indices/stats/IndexStatsIT.java @@ -41,6 +41,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexService; @@ -594,7 +595,8 @@ public class IndexStatsIT extends ESIntegTestCase { public void testSegmentsStats() { assertAcked(prepareCreate("test_index") - .setSettings(Settings.builder().put(SETTING_NUMBER_OF_REPLICAS, between(0, 1)))); + .setSettings(Settings.builder().put(SETTING_NUMBER_OF_REPLICAS, between(0, 1)) + .put(IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.getKey(), TimeValue.MINUS_ONE))); ensureGreen(); NumShards test1 = getNumShards("test_index");