|
@@ -31,6 +31,7 @@ import org.elasticsearch.xpack.core.ml.job.config.Job;
|
|
import org.elasticsearch.xpack.core.ml.job.config.JobState;
|
|
import org.elasticsearch.xpack.core.ml.job.config.JobState;
|
|
import org.elasticsearch.xpack.ml.MachineLearning;
|
|
import org.elasticsearch.xpack.ml.MachineLearning;
|
|
import org.elasticsearch.xpack.ml.MlSingleNodeTestCase;
|
|
import org.elasticsearch.xpack.ml.MlSingleNodeTestCase;
|
|
|
|
+import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase;
|
|
import org.junit.After;
|
|
import org.junit.After;
|
|
|
|
|
|
import java.time.ZonedDateTime;
|
|
import java.time.ZonedDateTime;
|
|
@@ -57,7 +58,7 @@ public class TestFeatureLicenseTrackingIT extends MlSingleNodeTestCase {
|
|
private final Set<String> createdPipelines = new HashSet<>();
|
|
private final Set<String> createdPipelines = new HashSet<>();
|
|
|
|
|
|
@After
|
|
@After
|
|
- public void cleanup() {
|
|
|
|
|
|
+ public void cleanup() throws Exception {
|
|
for (String pipeline : createdPipelines) {
|
|
for (String pipeline : createdPipelines) {
|
|
try {
|
|
try {
|
|
client().execute(DeletePipelineAction.INSTANCE, new DeletePipelineRequest(pipeline)).actionGet();
|
|
client().execute(DeletePipelineAction.INSTANCE, new DeletePipelineRequest(pipeline)).actionGet();
|
|
@@ -65,6 +66,9 @@ public class TestFeatureLicenseTrackingIT extends MlSingleNodeTestCase {
|
|
logger.warn(() -> new ParameterizedMessage("error cleaning up pipeline [{}]", pipeline), ex);
|
|
logger.warn(() -> new ParameterizedMessage("error cleaning up pipeline [{}]", pipeline), ex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // Some of the tests have async side effects. We need to wait for these to complete before continuing
|
|
|
|
+ // the cleanup, otherwise unexpected indices may get created during the cleanup process.
|
|
|
|
+ BaseMlIntegTestCase.waitForPendingTasks(client());
|
|
}
|
|
}
|
|
|
|
|
|
public void testFeatureTrackingAnomalyJob() throws Exception {
|
|
public void testFeatureTrackingAnomalyJob() throws Exception {
|
|
@@ -125,7 +129,7 @@ public class TestFeatureLicenseTrackingIT extends MlSingleNodeTestCase {
|
|
.setInferenceConfig(new ClassificationConfig(3))
|
|
.setInferenceConfig(new ClassificationConfig(3))
|
|
.setParsedDefinition(
|
|
.setParsedDefinition(
|
|
new TrainedModelDefinition.Builder().setPreProcessors(
|
|
new TrainedModelDefinition.Builder().setPreProcessors(
|
|
- Arrays.asList(new OneHotEncoding("other.categorical", oneHotEncoding, false))
|
|
|
|
|
|
+ List.of(new OneHotEncoding("other.categorical", oneHotEncoding, false))
|
|
).setTrainedModel(buildClassification(true))
|
|
).setTrainedModel(buildClassification(true))
|
|
)
|
|
)
|
|
.build();
|
|
.build();
|