Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: panguixin <panguixin@bytedance.com>
  • Loading branch information
bugmakerrrrrr committed May 31, 2024
1 parent f29bf75 commit f8b1083
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ public void testFileCacheRemoteShardsDecisions() {
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), true)
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "60%")
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "70%")
.put(DATA_TO_FILE_CACHE_SIZE_RATIO_SETTING.getKey(), 5)
.build();

// We have an index with 2 primary shards each taking 40 bytes. Each node has 100 bytes available
Expand All @@ -406,7 +407,6 @@ public void testFileCacheRemoteShardsDecisions() {
DiskThresholdDecider diskThresholdDecider = makeDecider(diskSettings);
Metadata metadata = Metadata.builder()
.put(IndexMetadata.builder("test").settings(remoteIndexSettings(Version.CURRENT)).numberOfShards(2).numberOfReplicas(0))
.persistentSettings(Settings.builder().put(DATA_TO_FILE_CACHE_SIZE_RATIO_SETTING.getKey(), 5).build())
.build();

RoutingTable initialRoutingTable = RoutingTable.builder().addAsNew(metadata.index("test")).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@
import static java.util.Collections.emptySet;
import static org.opensearch.action.support.ActionTestUtils.assertNoFailureListener;
import static org.opensearch.env.Environment.PATH_HOME_SETTING;
import static org.opensearch.index.store.remote.filecache.FileCacheSettings.DATA_TO_FILE_CACHE_SIZE_RATIO_SETTING;
import static org.opensearch.monitor.StatusInfo.Status.HEALTHY;
import static org.opensearch.node.Node.NODE_NAME_SETTING;
import static org.opensearch.node.Node.NODE_SEARCH_CACHE_SIZE_SETTING;
Expand Down Expand Up @@ -1681,7 +1680,6 @@ private Environment createEnvironment(String nodeName) {
ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(),
ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(Settings.EMPTY)
)
.put(DATA_TO_FILE_CACHE_SIZE_RATIO_SETTING.getKey(), 5)
.put(MappingUpdatedAction.INDICES_MAX_IN_FLIGHT_UPDATES_SETTING.getKey(), 1000) // o.w. some tests might block
.build()
);
Expand Down Expand Up @@ -2253,7 +2251,7 @@ public void onFailure(final Exception e) {
shardLimitValidator,
indicesService,
clusterInfoService::getClusterInfo,
() -> 0.0
() -> 5.0
);
actions.put(
PutMappingAction.INSTANCE,
Expand Down

0 comments on commit f8b1083

Please sign in to comment.