From 8c33cad2b23f8675dd5b2f9d853c65a1de2651ec Mon Sep 17 00:00:00 2001 From: David Roberts Date: Wed, 15 Apr 2020 09:43:29 +0100 Subject: [PATCH] [TEST] Lower ML model memory limit in HLRC datafeed tests (#55210) The MachineLearningIT.testStopDatafeed test was creating 3 jobs each with the default model memory limit of 1GB. This meant that the test would not run on a machine with less than 10GB of RAM (due to the default ML memory percentage of 30%). This change reduces the model memory limit for these jobs to 0.5GB, which means the test will run on a machine with only 5GB of RAM. Relates to https://discuss.elastic.co/t/failed-ml-tests-when-running-the-gradle-check-task-against-unchanged-repo-code/227829 --- .../test/java/org/elasticsearch/client/MachineLearningIT.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java index 08ce2d5f5cc..04673f63581 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java @@ -162,6 +162,7 @@ import org.elasticsearch.client.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.client.ml.inference.trainedmodel.TargetType; import org.elasticsearch.client.ml.inference.trainedmodel.langident.LangIdentNeuralNetwork; import org.elasticsearch.client.ml.job.config.AnalysisConfig; +import org.elasticsearch.client.ml.job.config.AnalysisLimits; import org.elasticsearch.client.ml.job.config.DataDescription; import org.elasticsearch.client.ml.job.config.Detector; import org.elasticsearch.client.ml.job.config.Job; @@ -2572,6 +2573,7 @@ public class MachineLearningIT extends ESRestHighLevelClientTestCase { //should not be random, see:https://github.com/elastic/ml-cpp/issues/208 configBuilder.setBucketSpan(new TimeValue(5, TimeUnit.SECONDS)); builder.setAnalysisConfig(configBuilder); + builder.setAnalysisLimits(new AnalysisLimits(512L, 4L)); DataDescription.Builder dataDescription = new DataDescription.Builder(); dataDescription.setTimeFormat(DataDescription.EPOCH_MS);