Skip to content

Commit

Permalink
Disable merges in testReuseInFileBasedPeerRecovery
Browse files Browse the repository at this point in the history
The test assumes lucene files don't change.

Closes #35772
  • Loading branch information
bleskes committed Dec 3, 2018
1 parent 74aca75 commit 36ddca7
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.MergePolicyConfig;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.shard.ShardId;
Expand All @@ -46,6 +47,7 @@
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.InternalTestCluster;
import org.elasticsearch.test.InternalTestCluster.RestartCallback;
import org.elasticsearch.test.store.MockFSIndexStore;
Expand Down Expand Up @@ -81,7 +83,7 @@ public class RecoveryFromGatewayIT extends ESIntegTestCase {

@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(MockFSIndexStore.TestPlugin.class);
return Arrays.asList(MockFSIndexStore.TestPlugin.class, InternalSettingsPlugin.class);
}

public void testOneNodeRecoverFromGateway() throws Exception {
Expand Down Expand Up @@ -404,8 +406,12 @@ public void testReuseInFileBasedPeerRecovery() throws Exception {
.admin()
.indices()
.prepareCreate("test")
.setSettings(Settings.builder().put("number_of_shards", 1).put("number_of_replicas", 1))
.get();
.setSettings(Settings.builder()
.put("number_of_shards", 1)
.put("number_of_replicas", 1)
// disable merges to keep segments the same
.put(MergePolicyConfig.INDEX_MERGE_ENABLED, "false")
).get();

logger.info("--> indexing docs");
int numDocs = randomIntBetween(1, 1024);
Expand Down

0 comments on commit 36ddca7

Please sign in to comment.