[ML] Set the correct close timeout

Original commit: elastic/x-pack-elasticsearch@aa0245cc28
This commit is contained in:
Martijn van Groningen 2017-03-31 14:01:09 +02:00
parent 9da2853d12
commit 878c7a4eb9
4 changed files with 5 additions and 5 deletions

View File

@ -419,7 +419,7 @@ public class MachineLearningLicensingTests extends BaseMlIntegTestCase {
client.addTransportAddress(internalCluster().getDataNodeInstance(Transport.class).boundAddress().publishAddress());
PlainListenableActionFuture<CloseJobAction.Response> listener = new PlainListenableActionFuture<>(client.threadPool());
CloseJobAction.Request request = new CloseJobAction.Request("foo");
request.setTimeout(TimeValue.timeValueSeconds(30));
request.setCloseTimeout(TimeValue.timeValueSeconds(20));
if (invalidLicense) {
// the close due to invalid license happens async, so check if the job turns into closed state:
assertBusy(() -> {

View File

@ -33,7 +33,7 @@ public class CloseJobActionRequestTests extends AbstractStreamableXContentTestCa
protected Request createTestInstance() {
Request request = new Request(randomAsciiOfLengthBetween(1, 20));
if (randomBoolean()) {
request.setTimeout(TimeValue.timeValueMillis(randomNonNegativeLong()));
request.setCloseTimeout(TimeValue.timeValueMillis(randomNonNegativeLong()));
}
if (randomBoolean()) {
request.setForce(randomBoolean());

View File

@ -92,7 +92,7 @@ public class TooManyJobsIT extends BaseMlIntegTestCase {
// close the first job and check if the latest job gets opened:
CloseJobAction.Request closeRequest = new CloseJobAction.Request("1");
closeRequest.setTimeout(TimeValue.timeValueSeconds(30L));
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(20L));
CloseJobAction.Response closeResponse = client().execute(CloseJobAction.INSTANCE, closeRequest).actionGet();
assertTrue(closeResponse.isClosed());
client().execute(OpenJobAction.INSTANCE, openJobRequest).get();

View File

@ -289,7 +289,7 @@ public abstract class BaseMlIntegTestCase extends ESIntegTestCase {
String jobId = entry.getKey();
try {
CloseJobAction.Request closeRequest = new CloseJobAction.Request(jobId);
closeRequest.setTimeout(TimeValue.timeValueSeconds(30L));
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(20L));
logger.info("Closing job [{}]", jobId);
CloseJobAction.Response response =
client.execute(CloseJobAction.INSTANCE, closeRequest).get();
@ -301,7 +301,7 @@ public abstract class BaseMlIntegTestCase extends ESIntegTestCase {
try {
CloseJobAction.Request closeRequest = new CloseJobAction.Request(jobId);
closeRequest.setForce(true);
closeRequest.setTimeout(TimeValue.timeValueSeconds(30L));
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(20L));
CloseJobAction.Response response =
client.execute(CloseJobAction.INSTANCE, closeRequest).get();
assertTrue(response.isClosed());