From 4e8ee658bb169c435691add22e02a3da75103fa5 Mon Sep 17 00:00:00 2001 From: Rishab Nahata Date: Tue, 13 Aug 2024 23:39:22 +0530 Subject: [PATCH] Remove unnecessary tests Signed-off-by: Rishab Nahata --- .../PrimaryShardBatchAllocatorTests.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java b/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java index e0bbccf7a5f71..2edde8281b11a 100644 --- a/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java +++ b/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java @@ -284,45 +284,6 @@ public void testAllocateUnassignedBatchOnTimeoutWithNoMatchingPrimaryShards() { assertEquals(0, ignoredShards.size()); } - public void testAllocateUnassignedBatchOnTimeoutWithNonPrimaryShards() { - ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); - AllocationDeciders allocationDeciders = randomAllocationDeciders(Settings.builder().build(), clusterSettings, random()); - setUpShards(1); - final RoutingAllocation routingAllocation = routingAllocationWithOnePrimary(allocationDeciders, CLUSTER_RECOVERED, "allocId-0"); - - ShardRouting shardRouting = routingAllocation.routingTable() - .getIndicesRouting() - .get("test") - .shard(shardId.id()) - .replicaShards() - .get(0); - Set shardIds = new HashSet<>(); - shardIds.add(shardRouting.shardId()); - batchAllocator.allocateUnassignedBatchOnTimeout(shardIds, routingAllocation, false); - - List ignoredShards = routingAllocation.routingNodes().unassigned().ignored(); - assertEquals(1, ignoredShards.size()); - } - - public void testAllocateUnassignedBatchOnTimeoutWithNoShards() { - ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); - AllocationDeciders allocationDeciders = randomAllocationDeciders(Settings.builder().build(), clusterSettings, random()); - setUpShards(1); - final RoutingAllocation routingAllocation = routingAllocationWithOnePrimary(allocationDeciders, CLUSTER_RECOVERED, "allocId-0"); - - ShardRouting shardRouting = routingAllocation.routingTable() - .getIndicesRouting() - .get("test") - .shard(shardId.id()) - .replicaShards() - .get(0); - Set shardIds = new HashSet<>(); - batchAllocator.allocateUnassignedBatchOnTimeout(shardIds, routingAllocation, false); - - List ignoredShards = routingAllocation.routingNodes().unassigned().ignored(); - assertEquals(0, ignoredShards.size()); - } - public void testAllocateUnassignedBatchOnTimeoutSkipIgnoringNewPrimaryShards() { ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); AllocationDeciders allocationDeciders = randomAllocationDeciders(Settings.builder().build(), clusterSettings, random());