Skip to content

Commit 83f6f0b

Browse files
authored
Add canForceAllocateDuringReplace test for WriteLoadConstaintDecider (#137221)
1 parent d0bf1de commit 83f6f0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/WriteLoadConstraintDeciderTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.cluster.routing.allocation.WriteLoadConstraintSettings;
2828
import org.elasticsearch.common.Strings;
2929
import org.elasticsearch.common.regex.Regex;
30+
import org.elasticsearch.common.settings.ClusterSettings;
3031
import org.elasticsearch.common.settings.Settings;
3132
import org.elasticsearch.index.Index;
3233
import org.elasticsearch.index.shard.ShardId;
@@ -35,9 +36,15 @@
3536
import java.util.HashMap;
3637

3738
import static org.elasticsearch.common.settings.ClusterSettings.createBuiltInClusterSettings;
39+
import static org.mockito.ArgumentMatchers.any;
3840

3941
public class WriteLoadConstraintDeciderTests extends ESAllocationTestCase {
4042

43+
public void testCanAlwaysAllocateDuringReplace() {
44+
var wld = new WriteLoadConstraintDecider(ClusterSettings.createBuiltInClusterSettings());
45+
assertEquals(Decision.YES, wld.canForceAllocateDuringReplace(any(), any(), any()));
46+
}
47+
4148
/**
4249
* Test the write load decider behavior when disabled
4350
*/

0 commit comments

Comments
 (0)