diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java index 7896dbe2591..bb58b4f40d5 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java @@ -85,7 +85,9 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase { PutJobAction.Request putJobRequest = new PutJobAction.Request(job.build()); PutJobAction.Response putJobResponse = client().execute(PutJobAction.INSTANCE, putJobRequest).get(); assertTrue(putJobResponse.isAcknowledged()); - DatafeedConfig config = createDatafeed("data_feed_id", job.getId(), Collections.singletonList("*")); + DatafeedConfig.Builder configBuilder = createDatafeedBuilder("data_feed_id", job.getId(), Collections.singletonList("*")); + configBuilder.setFrequency(120); + DatafeedConfig config = configBuilder.build(); PutDatafeedAction.Request putDatafeedRequest = new PutDatafeedAction.Request(config); PutDatafeedAction.Response putDatadeedResponse = client().execute(PutDatafeedAction.INSTANCE, putDatafeedRequest).get(); assertTrue(putDatadeedResponse.isAcknowledged()); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java index 6c182e7f890..a8ac66211ca 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java @@ -133,18 +133,23 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase { } public static DatafeedConfig createDatafeed(String datafeedId, String jobId, List indexes) { + return createDatafeedBuilder(datafeedId, jobId, indexes).build(); + } + + public static DatafeedConfig.Builder createDatafeedBuilder(String datafeedId, String jobId, List indexes) { DatafeedConfig.Builder builder = new DatafeedConfig.Builder(datafeedId, jobId); builder.setQueryDelay(1); builder.setFrequency(2); builder.setIndexes(indexes); builder.setTypes(Collections.singletonList("type")); - return builder.build(); + return builder; } @After public void cleanupWorkaround() throws Exception { deleteAllDatafeeds(client()); deleteAllJobs(client()); + internalCluster().wipe(Collections.emptySet()); assertBusy(() -> { RecoveryResponse recoveryResponse = client().admin().indices().prepareRecoveries() .setActiveOnly(true)