5
5
*/
6
6
package org .elasticsearch .xpack .ml .integration ;
7
7
8
- import org .elasticsearch .cluster .ClusterState ;
9
8
import org .elasticsearch .cluster .routing .UnassignedInfo ;
10
9
import org .elasticsearch .common .io .stream .Writeable ;
11
10
import org .elasticsearch .common .settings .Settings ;
12
11
import org .elasticsearch .common .unit .TimeValue ;
13
12
import org .elasticsearch .common .xcontent .ToXContent ;
14
13
import org .elasticsearch .index .reindex .ReindexPlugin ;
15
14
import org .elasticsearch .plugins .Plugin ;
16
- import org .elasticsearch .xpack .core .XPackSettings ;
17
15
import org .elasticsearch .xpack .core .ml .action .DeleteJobAction ;
18
16
import org .elasticsearch .xpack .core .ml .action .PutJobAction ;
19
17
import org .elasticsearch .xpack .core .ml .action .util .QueryPage ;
32
30
import org .elasticsearch .xpack .core .ml .job .results .Influencer ;
33
31
import org .elasticsearch .xpack .core .ml .job .results .ModelPlot ;
34
32
import org .elasticsearch .xpack .ml .LocalStateMachineLearning ;
35
- import org .elasticsearch .xpack .ml .MachineLearning ;
36
33
import org .elasticsearch .xpack .ml .MlSingleNodeTestCase ;
37
34
import org .elasticsearch .xpack .ml .job .persistence .BucketsQueryBuilder ;
38
35
import org .elasticsearch .xpack .ml .job .persistence .InfluencersQueryBuilder ;
@@ -77,17 +74,6 @@ public class AutodetectResultProcessorIT extends MlSingleNodeTestCase {
77
74
private AutoDetectResultProcessor resultProcessor ;
78
75
private Renormalizer renormalizer ;
79
76
80
- @ Override
81
- protected Settings nodeSettings () {
82
- Settings .Builder newSettings = Settings .builder ();
83
- newSettings .put (super .nodeSettings ());
84
- // Disable security otherwise delete-by-query action fails to get authorized
85
- newSettings .put (XPackSettings .SECURITY_ENABLED .getKey (), false );
86
- newSettings .put (XPackSettings .MONITORING_ENABLED .getKey (), false );
87
- newSettings .put (XPackSettings .WATCHER_ENABLED .getKey (), false );
88
- return newSettings .build ();
89
- }
90
-
91
77
@ Override
92
78
protected Collection <Class <? extends Plugin >> getPlugins () {
93
79
return pluginList (LocalStateMachineLearning .class , ReindexPlugin .class );
@@ -108,7 +94,7 @@ protected void updateModelSnapshotIdOnJob(ModelSnapshot modelSnapshot) {
108
94
capturedUpdateModelSnapshotOnJobRequests .add (modelSnapshot );
109
95
}
110
96
};
111
- putIndexTemplates ();
97
+ waitForMlTemplates ();
112
98
putJob ();
113
99
}
114
100
@@ -287,15 +273,6 @@ public void testEndOfStreamTriggersPersisting() throws Exception {
287
273
assertResultsAreSame (allRecords , persistedRecords );
288
274
}
289
275
290
- private void putIndexTemplates () throws Exception {
291
- // block until the templates are installed
292
- assertBusy (() -> {
293
- ClusterState state = client ().admin ().cluster ().prepareState ().get ().getState ();
294
- assertTrue ("Timed out waiting for the ML templates to be installed" ,
295
- MachineLearning .allTemplatesInstalled (state ));
296
- });
297
- }
298
-
299
276
private void putJob () {
300
277
Detector detector = new Detector .Builder ("dc" , "by_instance" ).build ();
301
278
Job .Builder jobBuilder = new Job .Builder (JOB_ID );
0 commit comments