Skip to content

Commit da6bf42

Browse files
[ML][TEST] Make AutodetectMemoryLimitIT less fragile (#30716)
These tests aim to check the set model memory limit is respected. Additionally, it was asserting counts of partition, by, over fields in an attempt to check that the used memory is spent meaningfully. However, this made the tests fragile, as changes in the ml-cpp could lead to CI failures. This commit removes those assertions. We are working on adding tests in ml-cpp that will compensate.
1 parent f820b48 commit da6bf42

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
public class AutodetectMemoryLimitIT extends MlNativeAutodetectIntegTestCase {
3434

3535
@After
36-
public void cleanUpTest() throws Exception {
36+
public void cleanUpTest() {
3737
cleanUp();
3838
}
3939

@@ -75,19 +75,10 @@ public void testTooManyPartitions() throws Exception {
7575
closeJob(job.getId());
7676

7777
// Assert we haven't violated the limit too much
78-
// and a balance of partitions/by fields were created
7978
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
8079
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
8180
assertThat(modelSizeStats.getModelBytes(), lessThan(35000000L));
8281
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));
83-
84-
// it is important to check that while we rejected partitions, we still managed
85-
// to create some by fields; it shows we utilize memory in a meaningful way
86-
// rather than creating empty partitions
87-
assertThat(modelSizeStats.getTotalPartitionFieldCount(), lessThan(900L));
88-
assertThat(modelSizeStats.getTotalPartitionFieldCount(), greaterThan(650L));
89-
assertThat(modelSizeStats.getTotalByFieldCount(), lessThan(900L));
90-
assertThat(modelSizeStats.getTotalByFieldCount(), greaterThan(650L));
9182
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
9283
}
9384

@@ -133,8 +124,6 @@ public void testTooManyByFields() throws Exception {
133124
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
134125
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
135126
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));
136-
assertThat(modelSizeStats.getTotalByFieldCount(), lessThan(1900L));
137-
assertThat(modelSizeStats.getTotalByFieldCount(), greaterThan(1500L));
138127
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
139128
}
140129

@@ -184,9 +173,6 @@ public void testTooManyByAndOverFields() throws Exception {
184173
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
185174
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
186175
assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
187-
assertThat(modelSizeStats.getTotalByFieldCount(), equalTo(7L));
188-
assertThat(modelSizeStats.getTotalOverFieldCount(), greaterThan(40000L));
189-
assertThat(modelSizeStats.getTotalOverFieldCount(), lessThan(50000L));
190176
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
191177
}
192178

@@ -237,7 +223,6 @@ public void testManyDistinctOverFields() throws Exception {
237223
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
238224
assertThat(modelSizeStats.getModelBytes(), lessThan(90000000L));
239225
assertThat(modelSizeStats.getModelBytes(), greaterThan(75000000L));
240-
assertThat(modelSizeStats.getTotalOverFieldCount(), greaterThan(140000L));
241226
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.OK));
242227
}
243228

0 commit comments

Comments
 (0)