Skip to content

Commit

Permalink
[ML][TEST] Make AutodetectMemoryLimitIT less fragile (#30716)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dimitris-athanasiou committed May 18, 2018
1 parent f820b48 commit da6bf42
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class AutodetectMemoryLimitIT extends MlNativeAutodetectIntegTestCase {

@After
public void cleanUpTest() throws Exception {
public void cleanUpTest() {
cleanUp();
}

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

// Assert we haven't violated the limit too much
// and a balance of partitions/by fields were created
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(35000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));

// it is important to check that while we rejected partitions, we still managed
// to create some by fields; it shows we utilize memory in a meaningful way
// rather than creating empty partitions
assertThat(modelSizeStats.getTotalPartitionFieldCount(), lessThan(900L));
assertThat(modelSizeStats.getTotalPartitionFieldCount(), greaterThan(650L));
assertThat(modelSizeStats.getTotalByFieldCount(), lessThan(900L));
assertThat(modelSizeStats.getTotalByFieldCount(), greaterThan(650L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

Expand Down Expand Up @@ -133,8 +124,6 @@ public void testTooManyByFields() throws Exception {
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(30000000L));
assertThat(modelSizeStats.getTotalByFieldCount(), lessThan(1900L));
assertThat(modelSizeStats.getTotalByFieldCount(), greaterThan(1500L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

Expand Down Expand Up @@ -184,9 +173,6 @@ public void testTooManyByAndOverFields() throws Exception {
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(36000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
assertThat(modelSizeStats.getTotalByFieldCount(), equalTo(7L));
assertThat(modelSizeStats.getTotalOverFieldCount(), greaterThan(40000L));
assertThat(modelSizeStats.getTotalOverFieldCount(), lessThan(50000L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

Expand Down Expand Up @@ -237,7 +223,6 @@ public void testManyDistinctOverFields() throws Exception {
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(90000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(75000000L));
assertThat(modelSizeStats.getTotalOverFieldCount(), greaterThan(140000L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.OK));
}

Expand Down

0 comments on commit da6bf42

Please sign in to comment.