Skip to content

Commit df40850

Browse files
author
Gagan Singh Saini
committed
fixing failing IT
Signed-off-by: Gagan Singh Saini <gagasa@amazon.com>
1 parent 03e7aff commit df40850

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.opensearch.cluster.ClusterState;
4545
import org.opensearch.cluster.metadata.IndexMetadata;
4646
import org.opensearch.cluster.metadata.Metadata;
47+
import org.opensearch.cluster.routing.RoutingPool;
4748
import org.opensearch.common.Priority;
4849
import org.opensearch.common.network.NetworkModule;
4950
import org.opensearch.common.settings.Settings;
@@ -855,40 +856,38 @@ private void verifyException(int dataNodes, ShardCounts counts, IllegalArgumentE
855856
int totalShards = counts.getFailingIndexShards() * (1 + counts.getFailingIndexReplicas());
856857
int currentShards = counts.getFirstIndexShards() * (1 + counts.getFirstIndexReplicas());
857858
int maxShards = counts.getShardsPerNode() * dataNodes;
858-
String shardType = getShardType();
859859
String expectedError = "Validation Failed: 1: this action would add ["
860860
+ totalShards
861861
+ "] total "
862-
+ shardType
862+
+ getShardType()
863863
+ " shards, but this cluster currently has ["
864864
+ currentShards
865865
+ "]/["
866866
+ maxShards
867867
+ "] maximum "
868-
+ shardType
868+
+ getShardType()
869869
+ " shards open;";
870870
assertEquals(expectedError, e.getMessage());
871871
}
872872

873873
private void verifyException(int maxShards, int currentShards, int extraShards, IllegalArgumentException e) {
874-
String shardType = getShardType();
875874
String expectedError = "Validation Failed: 1: this action would add ["
876875
+ extraShards
877876
+ "] total "
878-
+ shardType
877+
+ getShardType()
879878
+ " shards, but this cluster currently has ["
880879
+ currentShards
881880
+ "]/["
882881
+ maxShards
883882
+ "] maximum "
884-
+ shardType
883+
+ getShardType()
885884
+ " shards open;";
886885
assertEquals(expectedError, e.getMessage());
887886
}
888887

889-
private String getShardType() {
888+
private RoutingPool getShardType() {
890889
Boolean isWarmIndex = WRITABLE_WARM_INDEX_SETTING.get(settings);
891-
return isWarmIndex ? "Warm" : "Hot";
890+
return isWarmIndex ? RoutingPool.REMOTE_CAPABLE : RoutingPool.LOCAL_ONLY;
892891
}
893892

894893
private Settings warmNodeSettings(ByteSizeValue cacheSize) {

0 commit comments

Comments
 (0)