Skip to content

Commit

Permalink
[TEST] Increase timeout for ML internal cluster cleanup (elastic#50142)
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 authored and SivagurunathanV committed Jan 21, 2020
1 parent 67d3cb7 commit 8102a52
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,24 +313,24 @@ public static void deleteAllJobs(Logger logger, Client client) throws Exception

try {
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);
CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest)
.get();
CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest).get();
assertTrue(response.isClosed());
} catch (Exception e1) {
try {
CloseJobAction.Request closeRequest = new CloseJobAction.Request(MetaData.ALL);
closeRequest.setForce(true);
closeRequest.setCloseTimeout(TimeValue.timeValueSeconds(30L));
CloseJobAction.Response response =
client.execute(CloseJobAction.INSTANCE, closeRequest).get();
CloseJobAction.Response response = client.execute(CloseJobAction.INSTANCE, closeRequest).get();
assertTrue(response.isClosed());
} catch (Exception e2) {
logger.warn("Force-closing jobs failed.", e2);
}
throw new RuntimeException("Had to resort to force-closing job, something went wrong?",
e1);
throw new RuntimeException("Had to resort to force-closing job, something went wrong?", e1);
}

for (final Job job : jobs.results()) {
Expand Down

0 comments on commit 8102a52

Please sign in to comment.