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
This commit is contained in:
Nhat Nguyen 2020-01-07 10:08:13 -05:00
parent 0753915eed
commit c3d207f437
1 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexModule;
import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexService;
@ -594,7 +595,8 @@ public class IndexStatsIT extends ESIntegTestCase {
public void testSegmentsStats() { public void testSegmentsStats() {
assertAcked(prepareCreate("test_index") 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(); ensureGreen();
NumShards test1 = getNumShards("test_index"); NumShards test1 = getNumShards("test_index");