Sfoglia il codice sorgente

[ML] Reenable integration test and relax test tolerance for Linux (#43031)

Tom Veasey 6 anni fa
parent
commit
f4496b9979

+ 4 - 3
x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/AutodetectMemoryLimitIT.java

@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.lessThan;
+import static org.hamcrest.Matchers.anyOf;
 
 /**
  * A set of tests that ensure we comply to the model memory limit
@@ -38,7 +39,6 @@ public class AutodetectMemoryLimitIT extends MlNativeAutodetectIntegTestCase {
         cleanUp();
     }
 
-    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/43013")
     public void testTooManyPartitions() throws Exception {
         assumeFalse("AwaitsFix(bugUrl = \"https://github.com/elastic/elasticsearch/issues/32033\")", Constants.WINDOWS);
         Detector.Builder detector = new Detector.Builder("count", null);
@@ -80,9 +80,10 @@ public class AutodetectMemoryLimitIT extends MlNativeAutodetectIntegTestCase {
         // 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(32000000L));
         assertThat(modelSizeStats.getModelBytes(), greaterThan(24000000L));
-        assertThat(modelSizeStats.getMemoryStatus(), equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT));
+        assertThat(modelSizeStats.getMemoryStatus(), anyOf(equalTo(ModelSizeStats.MemoryStatus.SOFT_LIMIT),
+                                                           equalTo(ModelSizeStats.MemoryStatus.HARD_LIMIT)));
     }
 
     public void testTooManyByFields() throws Exception {