[ml] [test] changed error handling

Original commit: elastic/x-pack-elasticsearch@75cacd82a4
This commit is contained in:
Martijn van Groningen 2017-02-10 15:27:40 +01:00
parent 5386beec29
commit dd33fae50f
1 changed files with 4 additions and 1 deletions

View File

@ -124,7 +124,10 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase {
client.execute(CloseJobAction.INSTANCE, new CloseJobAction.Request(jobId)).get(); client.execute(CloseJobAction.INSTANCE, new CloseJobAction.Request(jobId)).get();
assertTrue(response.isClosed()); assertTrue(response.isClosed());
} catch (Exception e) { } catch (Exception e) {
logger.warn("Job [" + jobId + "] couldn't be closed", e); // CONFLICT is ok, as it means the job has been closed already, which isn't an issue at all.
if (RestStatus.CONFLICT != ExceptionsHelper.status(e.getCause())) {
throw new RuntimeException(e);
}
} }
DeleteJobAction.Response response = DeleteJobAction.Response response =
client.execute(DeleteJobAction.INSTANCE, new DeleteJobAction.Request(jobId)).get(); client.execute(DeleteJobAction.INSTANCE, new DeleteJobAction.Request(jobId)).get();