|
@@ -59,7 +59,7 @@ public class StartTrainedModelDeploymentRequestTests extends AbstractSerializing
|
|
|
request.setNumberOfAllocations(randomIntBetween(1, 8));
|
|
|
}
|
|
|
if (randomBoolean()) {
|
|
|
- request.setQueueCapacity(randomIntBetween(1, 10000));
|
|
|
+ request.setQueueCapacity(randomIntBetween(1, 1000000));
|
|
|
}
|
|
|
return request;
|
|
|
}
|
|
@@ -150,6 +150,25 @@ public class StartTrainedModelDeploymentRequestTests extends AbstractSerializing
|
|
|
assertThat(e.getMessage(), containsString("[queue_capacity] must be a positive integer"));
|
|
|
}
|
|
|
|
|
|
+ public void testValidate_GivenQueueCapacityIsAtLimit() {
|
|
|
+ Request request = createRandom();
|
|
|
+ request.setQueueCapacity(1_000_000);
|
|
|
+
|
|
|
+ ActionRequestValidationException e = request.validate();
|
|
|
+
|
|
|
+ assertThat(e, is(nullValue()));
|
|
|
+ }
|
|
|
+
|
|
|
+ public void testValidate_GivenQueueCapacityIsOverLimit() {
|
|
|
+ Request request = createRandom();
|
|
|
+ request.setQueueCapacity(1_000_001);
|
|
|
+
|
|
|
+ ActionRequestValidationException e = request.validate();
|
|
|
+
|
|
|
+ assertThat(e, is(not(nullValue())));
|
|
|
+ assertThat(e.getMessage(), containsString("[queue_capacity] must be less than 1000000"));
|
|
|
+ }
|
|
|
+
|
|
|
public void testDefaults() {
|
|
|
Request request = new Request(randomAlphaOfLength(10));
|
|
|
assertThat(request.getTimeout(), equalTo(TimeValue.timeValueSeconds(20)));
|