[TEST] Increase timeout for ML internal cluster cleanup (#50142)

Closes #48511
This commit is contained in:
David Roberts 2019-12-12 15:33:22 +00:00
parent 1186a5dc09
commit 13e47df97d
1 changed files with 7 additions and 7 deletions

View File

@ -332,24 +332,24 @@ public abstract class BaseMlIntegTestCase extends ESIntegTestCase {
try { try {
CloseJobAction.Request closeRequest = new CloseJobAction.Request(MetaData.ALL); CloseJobAction.Request closeRequest = new CloseJobAction.Request(MetaData.ALL);
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(30L)); // This usually takes a lot less than 90 seconds, but has been observed to be very slow occasionally
// in CI and a 90 second timeout will avoid the cost of investigating these intermittent failures.
// See https://github.com/elastic/elasticsearch/issues/48511
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(90L));
logger.info("Closing jobs using [{}]", MetaData.ALL); logger.info("Closing jobs using [{}]", MetaData.ALL);
CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest) CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest).get();
.get();
assertTrue(response.isClosed()); assertTrue(response.isClosed());
} catch (Exception e1) { } catch (Exception e1) {
try { try {
CloseJobAction.Request closeRequest = new CloseJobAction.Request(MetaData.ALL); CloseJobAction.Request closeRequest = new CloseJobAction.Request(MetaData.ALL);
closeRequest.setForce(true); closeRequest.setForce(true);
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(30L)); closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(30L));
CloseJobAction.Response response = CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest).get();
client.execute(CloseJobAction.INSTANCE, closeRequest).get();
assertTrue(response.isClosed()); assertTrue(response.isClosed());
} catch (Exception e2) { } catch (Exception e2) {
logger.warn("Force-closing jobs failed.", e2); logger.warn("Force-closing jobs failed.", e2);
} }
throw new RuntimeException("Had to resort to force-closing job, something went wrong?", throw new RuntimeException("Had to resort to force-closing job, something went wrong?", e1);
e1);
} }
for (final Job job : jobs.results()) { for (final Job job : jobs.results()) {