Skip to content

Commit b688424

Browse files
Find and replace feature flag test case usages with TestUtils.
Replace all usages of `FeatureFlagSetter` in tests. Replace all usages of JVM system properties for feature flags in tests. Replace all usages of `initializeFeatureFlags` with `TestUtils.set` in tests. Signed-off-by: Finn Carroll <[email protected]>
1 parent 0313fbb commit b688424

29 files changed

+78
-85
lines changed

modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ public void testExistsQueryDocValuesDisabled() throws IOException {
100100

101101
@BeforeClass
102102
public static void createMapper() {
103-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(STAR_TREE_INDEX, "true").build());
103+
FeatureFlags.TestUtils.set(STAR_TREE_INDEX);
104104
}
105105

106106
@AfterClass
107107
public static void clearMapper() {
108-
FeatureFlags.initializeFeatureFlags(Settings.EMPTY);
108+
FeatureFlags.TestUtils.reset();
109109
}
110110

111111
public void testScaledFloatWithStarTree() throws Exception {

plugins/arrow-flight-rpc/src/internalClusterTest/java/org/opensearch/arrow/flight/ArrowFlightServerIT.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@
1616
import org.opensearch.cluster.node.DiscoveryNode;
1717
import org.opensearch.common.util.FeatureFlags;
1818
import org.opensearch.plugins.Plugin;
19-
import org.opensearch.test.FeatureFlagSetter;
2019
import org.opensearch.test.OpenSearchIntegTestCase;
2120
import org.junit.BeforeClass;
2221

2322
import java.util.Collection;
2423
import java.util.Collections;
2524
import java.util.concurrent.TimeUnit;
2625

26+
import static org.opensearch.common.util.FeatureFlags.ARROW_STREAMS_SETTING;
27+
2728
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, numDataNodes = 5)
2829
public class ArrowFlightServerIT extends OpenSearchIntegTestCase {
2930

3031
private FlightClientManager flightClientManager;
3132

3233
@BeforeClass
3334
public static void setupFeatureFlags() {
34-
FeatureFlagSetter.set(FeatureFlags.ARROW_STREAMS_SETTING.getKey());
35+
FeatureFlags.TestUtils.set(ARROW_STREAMS_SETTING);
3536
}
3637

3738
@Override

plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/FlightStreamPluginTests.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.opensearch.common.settings.Settings;
2222
import org.opensearch.common.util.FeatureFlags;
2323
import org.opensearch.plugins.SecureTransportSettingsProvider;
24-
import org.opensearch.test.FeatureFlagSetter;
2524
import org.opensearch.test.OpenSearchTestCase;
2625
import org.opensearch.threadpool.ExecutorBuilder;
2726
import org.opensearch.threadpool.ThreadPool;
@@ -37,13 +36,12 @@
3736
import static org.mockito.Mockito.when;
3837

3938
public class FlightStreamPluginTests extends OpenSearchTestCase {
40-
private Settings settings;
39+
private final Settings settings = Settings.EMPTY;
4140
private ClusterService clusterService;
4241

4342
@Override
4443
public void setUp() throws Exception {
4544
super.setUp();
46-
settings = Settings.builder().put(ARROW_STREAMS_SETTING.getKey(), true).build();
4745
clusterService = mock(ClusterService.class);
4846
ClusterState clusterState = mock(ClusterState.class);
4947
DiscoveryNodes nodes = mock(DiscoveryNodes.class);
@@ -53,8 +51,7 @@ public void setUp() throws Exception {
5351
}
5452

5553
public void testPluginEnabled() throws IOException {
56-
FeatureFlags.initializeFeatureFlags(settings);
57-
FeatureFlagSetter.set(ARROW_STREAMS_SETTING.getKey());
54+
FeatureFlags.TestUtils.set(ARROW_STREAMS_SETTING);
5855
FlightStreamPlugin plugin = new FlightStreamPlugin(settings);
5956
Collection<Object> components = plugin.createComponents(
6057
null,

plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/FlightClientManagerTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.opensearch.core.action.ActionListener;
2929
import org.opensearch.core.common.transport.BoundTransportAddress;
3030
import org.opensearch.core.common.transport.TransportAddress;
31-
import org.opensearch.test.FeatureFlagSetter;
3231
import org.opensearch.test.OpenSearchTestCase;
3332
import org.opensearch.threadpool.ThreadPool;
3433
import org.opensearch.transport.client.Client;
@@ -55,6 +54,7 @@
5554
import io.netty.util.NettyRuntime;
5655

5756
import static org.opensearch.arrow.flight.bootstrap.FlightClientManager.LOCATION_TIMEOUT_MS;
57+
import static org.opensearch.common.util.FeatureFlags.ARROW_STREAMS_SETTING;
5858
import static org.mockito.ArgumentMatchers.any;
5959
import static org.mockito.ArgumentMatchers.eq;
6060
import static org.mockito.Mockito.doAnswer;
@@ -89,7 +89,7 @@ public void setUp() throws Exception {
8989
super.setUp();
9090
locationUpdaterExecutor = Executors.newScheduledThreadPool(1);
9191

92-
FeatureFlagSetter.set(FeatureFlags.ARROW_STREAMS_SETTING.getKey());
92+
FeatureFlags.TestUtils.set(ARROW_STREAMS_SETTING);
9393
clusterService = mock(ClusterService.class);
9494
client = mock(Client.class);
9595
state = getDefaultState();

plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/FlightServiceTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.opensearch.common.settings.Settings;
2020
import org.opensearch.common.util.FeatureFlags;
2121
import org.opensearch.core.common.transport.TransportAddress;
22-
import org.opensearch.test.FeatureFlagSetter;
2322
import org.opensearch.test.OpenSearchTestCase;
2423
import org.opensearch.threadpool.ThreadPool;
2524
import org.opensearch.transport.client.Client;
@@ -32,6 +31,7 @@
3231
import java.util.concurrent.ExecutorService;
3332
import java.util.concurrent.atomic.AtomicInteger;
3433

34+
import static org.opensearch.common.util.FeatureFlags.ARROW_STREAMS_SETTING;
3535
import static org.mockito.Mockito.mock;
3636
import static org.mockito.Mockito.when;
3737

@@ -47,7 +47,7 @@ public class FlightServiceTests extends OpenSearchTestCase {
4747
@Override
4848
public void setUp() throws Exception {
4949
super.setUp();
50-
FeatureFlagSetter.set(FeatureFlags.ARROW_STREAMS_SETTING.getKey());
50+
FeatureFlags.TestUtils.set(ARROW_STREAMS_SETTING);
5151
int availablePort = getBasePort(9500) + port.addAndGet(1);
5252
settings = Settings.EMPTY;
5353
localNode = createNode(availablePort);

server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,7 @@ public void testIndexBlocks() {
605605
public void testResizeFailuresDuringMigration() {
606606
// We will keep all other settings correct for resize request,
607607
// So we only need to test for the failures due to cluster setting validation while migration
608-
final Settings directionEnabledNodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build();
609-
FeatureFlags.initializeFeatureFlags(directionEnabledNodeSettings);
608+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
610609
boolean isRemoteStoreEnabled = randomBoolean();
611610
CompatibilityMode compatibilityMode = randomFrom(CompatibilityMode.values());
612611
RemoteStoreNodeService.Direction migrationDirection = randomFrom(RemoteStoreNodeService.Direction.values());

server/src/test/java/org/opensearch/cluster/applicationtemplates/SystemTemplatesServiceTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.mockito.Mockito;
2424

2525
import static org.opensearch.common.settings.ClusterSettings.BUILT_IN_CLUSTER_SETTINGS;
26+
import static org.opensearch.common.util.FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES;
2627
import static org.mockito.Mockito.when;
2728

2829
public class SystemTemplatesServiceTests extends OpenSearchTestCase {
@@ -77,7 +78,7 @@ public void testSystemTemplatesVerifyWithFailingRepository() throws IOException
7778
}
7879

7980
private void setupService(boolean errorFromMockPlugin) throws IOException {
80-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
81+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
8182

8283
ThreadPool mockPool = Mockito.mock(ThreadPool.class);
8384
when(mockPool.generic()).thenReturn(OpenSearchExecutors.newDirectExecutorService());

server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -1005,8 +1005,7 @@ public void testUpdatesRepoRemoteNodeJoinPublicationCluster() throws Exception {
10051005
.put(MIGRATION_DIRECTION_SETTING.getKey(), RemoteStoreNodeService.Direction.REMOTE_STORE)
10061006
.put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), "mixed")
10071007
.build();
1008-
final Settings nodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build();
1009-
FeatureFlags.initializeFeatureFlags(nodeSettings);
1008+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
10101009
Metadata metadata = Metadata.builder().persistentSettings(settings).build();
10111010

10121011
ClusterState currentState = ClusterState.builder(result.resultingState).metadata(metadata).build();
@@ -1071,8 +1070,7 @@ public void testUpdatesRepoPublicationNodeJoinRemoteCluster() throws Exception {
10711070
.put(MIGRATION_DIRECTION_SETTING.getKey(), RemoteStoreNodeService.Direction.REMOTE_STORE)
10721071
.put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), "mixed")
10731072
.build();
1074-
final Settings nodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build();
1075-
FeatureFlags.initializeFeatureFlags(nodeSettings);
1073+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
10761074
Metadata metadata = Metadata.builder().persistentSettings(settings).build();
10771075

10781076
ClusterState currentState = ClusterState.builder(result.resultingState).metadata(metadata).build();
@@ -1332,8 +1330,7 @@ public void testRemoteRoutingTableNodeJoinNodeWithRemoteAndRoutingRepoDifference
13321330
.put(MIGRATION_DIRECTION_SETTING.getKey(), RemoteStoreNodeService.Direction.REMOTE_STORE)
13331331
.put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), "mixed")
13341332
.build();
1335-
final Settings nodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build();
1336-
FeatureFlags.initializeFeatureFlags(nodeSettings);
1333+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
13371334
Metadata metadata = Metadata.builder().persistentSettings(settings).build();
13381335
ClusterState currentState = ClusterState.builder(ClusterName.DEFAULT)
13391336
.nodes(DiscoveryNodes.builder().add(existingNode2).add(existingNode).localNodeId(existingNode.getId()).build())
@@ -1365,8 +1362,7 @@ public void testJoinRemoteStoreClusterWithRemotePublicationNodeInMixedMode() {
13651362
.put(MIGRATION_DIRECTION_SETTING.getKey(), RemoteStoreNodeService.Direction.REMOTE_STORE)
13661363
.put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), "mixed")
13671364
.build();
1368-
final Settings nodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build();
1369-
FeatureFlags.initializeFeatureFlags(nodeSettings);
1365+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
13701366
Metadata metadata = Metadata.builder().persistentSettings(settings).build();
13711367
ClusterState currentState = ClusterState.builder(ClusterName.DEFAULT)
13721368
.nodes(DiscoveryNodes.builder().add(remoteStoreNode).add(nonRemoteStoreNode).localNodeId(remoteStoreNode.getId()).build())

server/src/test/java/org/opensearch/cluster/metadata/MetadataCreateIndexServiceTests.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
import static org.opensearch.cluster.metadata.MetadataCreateIndexService.parseV1Mappings;
157157
import static org.opensearch.cluster.metadata.MetadataCreateIndexService.resolveAndValidateAliases;
158158
import static org.opensearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider.INDEX_TOTAL_PRIMARY_SHARDS_PER_NODE_SETTING;
159+
import static org.opensearch.common.util.FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES;
159160
import static org.opensearch.common.util.FeatureFlags.REMOTE_STORE_MIGRATION_EXPERIMENTAL;
160161
import static org.opensearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
161162
import static org.opensearch.index.IndexSettings.INDEX_MERGE_POLICY;
@@ -248,7 +249,7 @@ public void setupCreateIndexRequestAndAliasValidator() {
248249
public void tearDown() throws Exception {
249250
super.tearDown();
250251
// clear any FeatureFlags needed for individual tests
251-
FeatureFlags.initializeFeatureFlags(Settings.EMPTY);
252+
FeatureFlags.TestUtils.reset();
252253
clusterSettings = null;
253254
}
254255

@@ -1601,7 +1602,7 @@ public void testRemoteStoreOverrideTranslogRepoIndexSettings() {
16011602
}
16021603

16031604
public void testNewIndexIsRemoteStoreBackedForRemoteStoreDirectionAndMixedMode() {
1604-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build());
1605+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
16051606

16061607
// non-remote cluster manager node
16071608
DiscoveryNode nonRemoteClusterManagerNode = new DiscoveryNode(UUIDs.base64UUID(), buildNewFakeTransportAddress(), Version.CURRENT);
@@ -2314,7 +2315,7 @@ public void testIndexCreationWithIndexStoreTypeRemoteStoreThrowsException() {
23142315

23152316
public void testCreateIndexWithContextDisabled() throws Exception {
23162317
// Explicitly disable the FF
2317-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, false).build());
2318+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
23182319
request = new CreateIndexClusterStateUpdateRequest("create index", "test", "test").context(new Context(randomAlphaOfLength(5)));
23192320
withTemporaryClusterService((clusterService, threadPool) -> {
23202321
MetadataCreateIndexService checkerService = new MetadataCreateIndexService(
@@ -2347,7 +2348,7 @@ public void testCreateIndexWithContextDisabled() throws Exception {
23472348
}
23482349

23492350
public void testCreateIndexWithContextAbsent() throws Exception {
2350-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
2351+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
23512352
request = new CreateIndexClusterStateUpdateRequest("create index", "test", "test").context(new Context(randomAlphaOfLength(5)));
23522353
withTemporaryClusterService((clusterService, threadPool) -> {
23532354
MetadataCreateIndexService checkerService = new MetadataCreateIndexService(
@@ -2380,7 +2381,7 @@ public void testCreateIndexWithContextAbsent() throws Exception {
23802381
}
23812382

23822383
public void testApplyContext() throws IOException {
2383-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
2384+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
23842385
request = new CreateIndexClusterStateUpdateRequest("create index", "test", "test").context(new Context(randomAlphaOfLength(5)));
23852386

23862387
final Map<String, Object> mappings = new HashMap<>();
@@ -2477,7 +2478,7 @@ public void testApplyContext() throws IOException {
24772478
}
24782479

24792480
public void testApplyContextWithSettingsOverlap() throws IOException {
2480-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
2481+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
24812482
request = new CreateIndexClusterStateUpdateRequest("create index", "test", "test").context(new Context(randomAlphaOfLength(5)));
24822483
Settings.Builder settingsBuilder = Settings.builder().put(INDEX_REFRESH_INTERVAL_SETTING.getKey(), "30s");
24832484
String templateContent = "{\n"

server/src/test/java/org/opensearch/cluster/metadata/MetadataIndexTemplateServiceTests.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import static org.opensearch.cluster.applicationtemplates.SystemTemplateMetadata.fromComponentTemplateInfo;
9696
import static org.opensearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider.INDEX_TOTAL_PRIMARY_SHARDS_PER_NODE_SETTING;
9797
import static org.opensearch.common.settings.Settings.builder;
98+
import static org.opensearch.common.util.FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES;
9899
import static org.opensearch.common.util.concurrent.ThreadContext.ACTION_ORIGIN_TRANSIENT_NAME;
99100
import static org.opensearch.env.Environment.PATH_HOME_SETTING;
100101
import static org.opensearch.index.mapper.DataStreamFieldMapper.Defaults.TIMESTAMP_FIELD;
@@ -770,7 +771,7 @@ public void onFailure(Exception e) {
770771
}
771772

772773
public void testPutGlobalV2TemplateWhichProvidesContextNotPresentInState() throws Exception {
773-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
774+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
774775
MetadataIndexTemplateService metadataIndexTemplateService = getMetadataIndexTemplateService();
775776
ComposableIndexTemplate globalIndexTemplate = new ComposableIndexTemplate(
776777
List.of("*"),
@@ -810,7 +811,7 @@ public void onFailure(Exception e) {
810811
}
811812

812813
public void testPutGlobalV2TemplateWhichProvidesContextWithNonExistingVersion() throws Exception {
813-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
814+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
814815
MetadataIndexTemplateService metadataIndexTemplateService = getMetadataIndexTemplateService();
815816

816817
Function<String, Template> templateApplier = codec -> new Template(
@@ -894,7 +895,7 @@ public void onFailure(Exception e) {
894895
}
895896

896897
public void testPutGlobalV2TemplateWhichProvidesContextInComposedOfSection() throws Exception {
897-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
898+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
898899
MetadataIndexTemplateService metadataIndexTemplateService = getMetadataIndexTemplateService();
899900

900901
Function<String, Template> templateApplier = codec -> new Template(
@@ -981,7 +982,7 @@ public void testPutGlobalV2TemplateWhichProvidesContextWithLatestVersion() throw
981982
}
982983

983984
public void testModifySystemTemplateViaUnknownSource() throws Exception {
984-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
985+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
985986
MetadataIndexTemplateService metadataIndexTemplateService = getMetadataIndexTemplateService();
986987

987988
Function<String, Template> templateApplier = codec -> new Template(
@@ -2630,7 +2631,7 @@ public static void assertTemplatesEqual(ComposableIndexTemplate actual, Composab
26302631
}
26312632

26322633
private String verifyTemplateCreationUsingContext(String contextVersion) throws Exception {
2633-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, true).build());
2634+
FeatureFlags.TestUtils.set(APPLICATION_BASED_CONFIGURATION_TEMPLATES);
26342635
MetadataIndexTemplateService metadataIndexTemplateService = getMetadataIndexTemplateService();
26352636

26362637
Function<String, Template> templateApplier = codec -> new Template(
@@ -2751,9 +2752,6 @@ protected boolean resetNodeAfterTest() {
27512752

27522753
@Override
27532754
protected Settings featureFlagSettings() {
2754-
return Settings.builder()
2755-
.put(super.featureFlagSettings())
2756-
.put(FeatureFlags.APPLICATION_BASED_CONFIGURATION_TEMPLATES, false)
2757-
.build();
2755+
return Settings.builder().put(super.featureFlagSettings()).put(APPLICATION_BASED_CONFIGURATION_TEMPLATES, false).build();
27582756
}
27592757
}

server/src/test/java/org/opensearch/cluster/routing/allocation/FailedShardsRoutingTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ private void testReplicaIsPromoted(boolean isSegmentReplicationEnabled) {
826826
}
827827

828828
public void testPreferReplicaOnRemoteNodeForPrimaryPromotion() {
829-
FeatureFlags.initializeFeatureFlags(Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build());
829+
FeatureFlags.TestUtils.set(REMOTE_STORE_MIGRATION_EXPERIMENTAL);
830830
AllocationService allocation = createAllocationService(Settings.builder().build());
831831

832832
// segment replication enabled

server/src/test/java/org/opensearch/cluster/routing/allocation/ShardsTieringAllocationTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.opensearch.cluster.routing.ShardRouting;
1818
import org.opensearch.common.util.FeatureFlags;
1919
import org.opensearch.index.IndexModule;
20-
import org.opensearch.test.FeatureFlagSetter;
2120
import org.junit.Before;
2221

2322
import static org.opensearch.cluster.routing.RoutingPool.LOCAL_ONLY;
@@ -29,7 +28,7 @@ public class ShardsTieringAllocationTests extends TieringAllocationBaseTestCase
2928

3029
@Before
3130
public void setup() {
32-
FeatureFlagSetter.set(FeatureFlags.WRITABLE_WARM_INDEX_EXPERIMENTAL_FLAG);
31+
FeatureFlags.TestUtils.set(FeatureFlags.WRITABLE_WARM_INDEX_EXPERIMENTAL_FLAG);
3332
}
3433

3534
public void testShardsInLocalPool() {

0 commit comments

Comments
 (0)