Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML][TEST] Fix limits in AutodetectMemoryLimitIT #42279

Merged
merged 7 commits into from
May 21, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public void testTooManyPartitions() throws Exception {
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/42207")
public void testTooManyByFields() throws Exception {
Detector.Builder detector = new Detector.Builder("count", null);
detector.setByFieldName("user");
Expand Down Expand Up @@ -125,12 +124,11 @@ public void testTooManyByFields() throws Exception {
// Assert we haven't violated the limit too much
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(31500000L));
assertThat(modelSizeStats.getModelBytes(), lessThan(35000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(25000000L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/42207")
public void testTooManyByAndOverFields() throws Exception {
Detector.Builder detector = new Detector.Builder("count", null);
detector.setByFieldName("department");
Expand Down Expand Up @@ -175,12 +173,11 @@ public void testTooManyByAndOverFields() throws Exception {
// Assert we haven't violated the limit too much
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(31500000L));
assertThat(modelSizeStats.getModelBytes(), lessThan(33000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/42207")
public void testManyDistinctOverFields() throws Exception {
Detector.Builder detector = new Detector.Builder("sum", "value");
detector.setOverFieldName("user");
Expand Down Expand Up @@ -226,7 +223,7 @@ public void testManyDistinctOverFields() throws Exception {
// Assert we haven't violated the limit too much
GetJobsStatsAction.Response.JobStats jobStats = getJobStats(job.getId()).get(0);
ModelSizeStats modelSizeStats = jobStats.getModelSizeStats();
assertThat(modelSizeStats.getModelBytes(), lessThan(116000000L));
assertThat(modelSizeStats.getModelBytes(), lessThan(117000000L));
assertThat(modelSizeStats.getModelBytes(), greaterThan(90000000L));
assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
}
Expand Down