Skip to content

Commit

Permalink
Add segrep enbaled index settings in TargetServiceTests, SourceHandle…
Browse files Browse the repository at this point in the history
…rTests

Signed-off-by: Suraj Singh <surajrider@gmail.com>
  • Loading branch information
dreamer-89 committed Aug 8, 2022
1 parent 12a200f commit f59b6fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import org.opensearch.OpenSearchException;
import org.opensearch.Version;
import org.opensearch.action.ActionListener;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.settings.Settings;
import org.opensearch.index.shard.IndexShard;
import org.opensearch.index.shard.IndexShardTestCase;
import org.opensearch.index.store.StoreFileMetadata;
Expand All @@ -41,7 +43,8 @@ public class SegmentReplicationSourceHandlerTests extends IndexShardTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
primary = newStartedShard(true);
final Settings settings = Settings.builder().put(IndexMetadata.SETTING_REPLICATION_TYPE, "SEGMENT").put(Settings.EMPTY).build();
primary = newStartedShard(true, settings);
replica = newShard(primary.shardId(), false);
recoverReplica(replica, primary, true);
replicaDiscoveryNode = replica.recoveryState().getTargetNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.mockito.Mockito;
import org.opensearch.OpenSearchException;
import org.opensearch.action.ActionListener;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.index.shard.IndexShard;
Expand Down Expand Up @@ -50,7 +51,10 @@ public class SegmentReplicationTargetServiceTests extends IndexShardTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
final Settings settings = Settings.builder().put("node.name", SegmentReplicationTargetServiceTests.class.getSimpleName()).build();
final Settings settings = Settings.builder()
.put(IndexMetadata.SETTING_REPLICATION_TYPE, "SEGMENT")
.put("node.name", SegmentReplicationTargetServiceTests.class.getSimpleName())
.build();
final ClusterSettings clusterSettings = new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
final RecoverySettings recoverySettings = new RecoverySettings(settings, clusterSettings);
final TransportService transportService = mock(TransportService.class);
Expand Down

0 comments on commit f59b6fa

Please sign in to comment.