[TEST] Attempt to stabilize distributed ml tests.
Relates to elastic/x-pack-elasticsearch#653 Original commit: elastic/x-pack-elasticsearch@e4919ab2b4
This commit is contained in:
parent
e2f5715191
commit
212098fc7c
|
@ -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());
|
||||
|
|
|
@ -133,18 +133,23 @@ public abstract class BaseMlIntegTestCase extends SecurityIntegTestCase {
|
|||
}
|
||||
|
||||
public static DatafeedConfig createDatafeed(String datafeedId, String jobId, List<String> indexes) {
|
||||
return createDatafeedBuilder(datafeedId, jobId, indexes).build();
|
||||
}
|
||||
|
||||
public static DatafeedConfig.Builder createDatafeedBuilder(String datafeedId, String jobId, List<String> 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)
|
||||
|
|
Loading…
Reference in New Issue