From dd33fae50ffc9547fec57438218a23e0ccf804b6 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 10 Feb 2017 15:27:40 +0100 Subject: [PATCH] [ml] [test] changed error handling Original commit: elastic/x-pack-elasticsearch@75cacd82a47084c6a8e7fef03ba8687fc322663a --- .../elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java index f38bf9678a9..747379838e1 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java @@ -124,7 +124,10 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase { client.execute(CloseJobAction.INSTANCE, new CloseJobAction.Request(jobId)).get(); assertTrue(response.isClosed()); } 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 = client.execute(DeleteJobAction.INSTANCE, new DeleteJobAction.Request(jobId)).get();