[ML] Set the correct close timeout
Original commit: elastic/x-pack-elasticsearch@aa0245cc28
This commit is contained in:
parent
9da2853d12
commit
878c7a4eb9
|
@ -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(() -> {
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue