diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index 33a151f944f..13c70cbe562 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -43,7 +43,6 @@ import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.ParseField; @@ -565,11 +564,8 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest public void testRestoreIndexWithShardsMissingInLocalGateway() throws Exception { logger.info("--> start 2 nodes"); - Settings nodeSettings = Settings.builder() - .put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE) - .build(); - internalCluster().startNodes(2, nodeSettings); + internalCluster().startNodes(2); cluster().wipeIndices("_all"); createRepository("test-repo", "fs"); @@ -581,6 +577,10 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest indexRandomDocs("test-idx", 100); + logger.info("--> force merging down to a single segment to get a deterministic set of files"); + assertEquals(client().admin().indices().prepareForceMerge("test-idx").setMaxNumSegments(1).setFlush(true).get().getFailedShards(), + 0); + createSnapshot("test-repo", "test-snap-1", Collections.singletonList("test-idx")); logger.info("--> close the index");