Skip to content

Commit 66f7dd2

Browse files
authored
[ML] Update test thresholds to account for changes to memory control (#31289)
To avoid temporary failures, this also disables these tests until elastic/ml-cpp#122 is committed.
1 parent 8c9360b commit 66f7dd2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

x-pack/qa/ml-native-tests/src/test/java/org/elasticsearch/xpack/ml/integration/AutodetectMemoryLimitIT.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public void cleanUpTest() {
3737
cleanUp();
3838
}
3939

40+
@AwaitsFix(bugUrl = "https://github.com/elastic/ml-cpp/pulls/122")
4041
public void testTooManyPartitions() throws Exception {
4142
Detector.Builder detector = new Detector.Builder("count", null);
4243
detector.setPartitionFieldName("user");
@@ -77,11 +78,12 @@ public void testTooManyPartitions() throws Exception {
7778
// Assert we haven't violated the limit too much
7879
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
7980
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
80-
assertThat(modelSizeStats.getModelBytes(), lessThan(35000000L));
81-
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));
81+
assertThat(modelSizeStats.getModelBytes(), lessThan(31500000L));
82+
assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
8283
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
8384
}
8485

86+
@AwaitsFix(bugUrl = "https://github.com/elastic/ml-cpp/pulls/122")
8587
public void testTooManyByFields() throws Exception {
8688
Detector.Builder detector = new Detector.Builder("count", null);
8789
detector.setByFieldName("user");
@@ -122,11 +124,12 @@ public void testTooManyByFields() throws Exception {
122124
// Assert we haven't violated the limit too much
123125
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
124126
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
125-
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
126-
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));
127+
assertThat(modelSizeStats.getModelBytes(), lessThan(31500000L));
128+
assertThat(modelSizeStats.getModelBytes(), greaterThan(25000000L));
127129
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
128130
}
129131

132+
@AwaitsFix(bugUrl = "https://github.com/elastic/ml-cpp/pulls/122")
130133
public void testTooManyByAndOverFields() throws Exception {
131134
Detector.Builder detector = new Detector.Builder("count", null);
132135
detector.setByFieldName("department");
@@ -171,11 +174,12 @@ public void testTooManyByAndOverFields() throws Exception {
171174
// Assert we haven't violated the limit too much
172175
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
173176
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
174-
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
177+
assertThat(modelSizeStats.getModelBytes(), lessThan(31500000L));
175178
assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
176179
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
177180
}
178181

182+
@AwaitsFix(bugUrl = "https://github.com/elastic/ml-cpp/pulls/122")
179183
public void testManyDistinctOverFields() throws Exception {
180184
Detector.Builder detector = new Detector.Builder("sum", "value");
181185
detector.setOverFieldName("user");
@@ -221,9 +225,9 @@ public void testManyDistinctOverFields() throws Exception {
221225
// Assert we haven't violated the limit too much
222226
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
223227
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
224-
assertThat(modelSizeStats.getModelBytes(), lessThan(90000000L));
225-
assertThat(modelSizeStats.getModelBytes(), greaterThan(75000000L));
226-
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.OK));
228+
assertThat(modelSizeStats.getModelBytes(), lessThan(116000000L));
229+
assertThat(modelSizeStats.getModelBytes(), greaterThan(90000000L));
230+
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
227231
}
228232

229233
private static Map<String, Object> createRecord(long timestamp, String user, String department) {

0 commit comments

Comments
 (0)