From d3e4ebcc0e2df94dd00e31525381f4bce74ff620 Mon Sep 17 00:00:00 2001 From: Dimitrios Athanasiou Date: Thu, 12 Jan 2017 14:32:59 +0000 Subject: [PATCH] Fix ScheduledJobsIT failure Original commit: elastic/x-pack-elasticsearch@e43bb12ffb240c6b664764058c9d97757dad7475 --- .../elasticsearch/xpack/ml/action/ScheduledJobsIT.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/action/ScheduledJobsIT.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/action/ScheduledJobsIT.java index 0bdc818f608..2ba8c84e63f 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/action/ScheduledJobsIT.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/ml/action/ScheduledJobsIT.java @@ -36,6 +36,7 @@ import org.junit.After; import java.io.IOException; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -87,7 +88,7 @@ public class ScheduledJobsIT extends ESIntegTestCase { OpenJobAction.Response openJobResponse = client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId())).get(); assertTrue(openJobResponse.isAcknowledged()); - SchedulerConfig schedulerConfig = createScheduler(job.getId() + "-scheduler", job.getId()); + SchedulerConfig schedulerConfig = createScheduler(job.getId() + "-scheduler", job.getId(), Collections.singletonList("data-*")); PutSchedulerAction.Request putSchedulerRequest = new PutSchedulerAction.Request(schedulerConfig); PutSchedulerAction.Response putSchedulerResponse = client().execute(PutSchedulerAction.INSTANCE, putSchedulerRequest).get(); assertTrue(putSchedulerResponse.isAcknowledged()); @@ -122,7 +123,7 @@ public class ScheduledJobsIT extends ESIntegTestCase { OpenJobAction.Response openJobResponse = client().execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(job.getId())).get(); assertTrue(openJobResponse.isAcknowledged()); - SchedulerConfig schedulerConfig = createScheduler(job.getId() + "-scheduler", job.getId()); + SchedulerConfig schedulerConfig = createScheduler(job.getId() + "-scheduler", job.getId(), Collections.singletonList("data")); PutSchedulerAction.Request putSchedulerRequest = new PutSchedulerAction.Request(schedulerConfig); PutSchedulerAction.Response putSchedulerResponse = client().execute(PutSchedulerAction.INSTANCE, putSchedulerRequest).get(); assertTrue(putSchedulerResponse.isAcknowledged()); @@ -196,11 +197,11 @@ public class ScheduledJobsIT extends ESIntegTestCase { return builder; } - private SchedulerConfig createScheduler(String schedulerId, String jobId) { + private SchedulerConfig createScheduler(String schedulerId, String jobId, List indexes) { SchedulerConfig.Builder builder = new SchedulerConfig.Builder(schedulerId, jobId); builder.setQueryDelay(1); builder.setFrequency(2); - builder.setIndexes(Collections.singletonList("data-*")); + builder.setIndexes(indexes); builder.setTypes(Collections.singletonList("type")); return builder.build(); }