Prechádzať zdrojové kódy

[ML] unmutes and adds logging to BasicDistributedJobsIT tests (#69198)

previous work fixing a hard to detect `_close` race condition
: https://github.com/elastic/elasticsearch/pull/69136

May have fixed the test failures indicated in: https://github.com/elastic/elasticsearch/issues/63980

adding some logging and unmuting the previously flaky test to see if the issue has been addressed.

closes: https://github.com/elastic/elasticsearch/issues/63980
Benjamin Trent 4 rokov pred
rodič
commit
c9a1d11087

+ 29 - 1
x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java

@@ -59,9 +59,38 @@ import org.elasticsearch.xpack.core.ml.job.config.JobState;
 import org.elasticsearch.xpack.core.ml.job.config.JobTaskState;
 import org.elasticsearch.xpack.ml.MachineLearning;
 import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase;
+import org.junit.After;
+import org.junit.Before;
 
 public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
 
+    @Before
+    // upping the logging due to potential failures in: https://github.com/elastic/elasticsearch/issues/63980
+    public void setLogging() {
+        client().admin()
+            .cluster()
+            .prepareUpdateSettings()
+            .setTransientSettings(Settings.builder()
+                .put("logger.org.elasticsearch.xpack.ml.action.TransportCloseJobAction", "TRACE")
+                .put("logger.org.elasticsearch.xpack.ml.action.TransportOpenJobAction", "TRACE")
+                .put("logger.org.elasticsearch.xpack.ml.job.task.OpenJobPersistentTasksExecutor", "TRACE")
+                .put("logger.org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager", "TRACE")
+                .build()).get();
+    }
+
+    @After
+    public void unsetLogging() {
+        client().admin()
+            .cluster()
+            .prepareUpdateSettings()
+            .setTransientSettings(Settings.builder()
+                .putNull("logger.org.elasticsearch.xpack.ml.action.TransportCloseJobAction")
+                .putNull("logger.org.elasticsearch.xpack.ml.action.TransportOpenJobAction")
+                .putNull("logger.org.elasticsearch.xpack.ml.job.task.OpenJobPersistentTasksExecutor")
+                .putNull("logger.org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager")
+                .build()).get();
+    }
+
     public void testFailOverBasics() throws Exception {
         internalCluster().ensureAtLeastNumDataNodes(4);
         ensureStableCluster(4);
@@ -194,7 +223,6 @@ public class BasicDistributedJobsIT extends BaseMlIntegTestCase {
         });
     }
 
-    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/63980")
     public void testDedicatedMlNode() throws Exception {
         internalCluster().ensureAtMostNumDataNodes(0);
         // start 2 non ml node that will never get a job allocated. (but ml apis are accessible from this node)