Skip to content

Commit e045cf3

Browse files
author
Max Hniebergall
committed
Update tests to match new constants
1 parent 189ff78 commit e045cf3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class StartTrainedModelDeploymentAction extends ActionType<CreateTrainedM
7171
public static final AllocationStatus.State DEFAULT_WAITFOR_STATE = AllocationStatus.State.STARTED;
7272
public static final int DEFAULT_NUM_ALLOCATIONS = 1;
7373
public static final int DEFAULT_NUM_THREADS = 1;
74-
public static final int DEFAULT_QUEUE_CAPACITY = 10000;
74+
public static final int DEFAULT_QUEUE_CAPACITY = 10_000;
7575
public static final Priority DEFAULT_PRIORITY = Priority.NORMAL;
7676

7777
public StartTrainedModelDeploymentAction() {

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static Request createRandom() {
6767
request.setNumberOfAllocations(randomIntBetween(1, 8));
6868
}
6969
if (randomBoolean()) {
70-
request.setQueueCapacity(randomIntBetween(1, 1000000));
70+
request.setQueueCapacity(randomIntBetween(1, 100_000));
7171
}
7272
if (randomBoolean()) {
7373
request.setPriority(randomFrom(Priority.values()).toString());
@@ -168,7 +168,7 @@ public void testValidate_GivenQueueCapacityIsNegative() {
168168

169169
public void testValidate_GivenQueueCapacityIsAtLimit() {
170170
Request request = createRandom();
171-
request.setQueueCapacity(1_000_000);
171+
request.setQueueCapacity(100_000);
172172

173173
ActionRequestValidationException e = request.validate();
174174

@@ -177,12 +177,12 @@ public void testValidate_GivenQueueCapacityIsAtLimit() {
177177

178178
public void testValidate_GivenQueueCapacityIsOverLimit() {
179179
Request request = createRandom();
180-
request.setQueueCapacity(1_000_001);
180+
request.setQueueCapacity(100_001);
181181

182182
ActionRequestValidationException e = request.validate();
183183

184184
assertThat(e, is(not(nullValue())));
185-
assertThat(e.getMessage(), containsString("[queue_capacity] must be less than 1000000"));
185+
assertThat(e.getMessage(), containsString("[queue_capacity] must be less than 100000"));
186186
}
187187

188188
public void testValidate_GivenTimeoutIsNegative() {
@@ -234,6 +234,6 @@ public void testDefaults() {
234234
assertThat(request.getNumberOfAllocations(), nullValue());
235235
assertThat(request.computeNumberOfAllocations(), equalTo(1));
236236
assertThat(request.getThreadsPerAllocation(), equalTo(1));
237-
assertThat(request.getQueueCapacity(), equalTo(1024));
237+
assertThat(request.getQueueCapacity(), equalTo(10_000));
238238
}
239239
}

0 commit comments

Comments
 (0)