From 2b9032a07ddc06c88944e852ec889d0d5b8ff7a1 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 29 Sep 2020 08:12:20 -0400 Subject: [PATCH] [7.x] [ML] fixing testTwoJobsWithSameRandomizeSeedUseSameTrainingSet tests (#62976) (#62999) * [ML] fixing testTwoJobsWithSameRandomizeSeedUseSameTrainingSet tests (#62976) This fixes the two test failures. The shard failure seems to be due to the .ml-stats index being in the middle of being created. --- .../xpack/ml/integration/ClassificationIT.java | 6 ++---- .../elasticsearch/xpack/ml/integration/RegressionIT.java | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java index 841a09a549a..9315b5044e9 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java @@ -643,6 +643,8 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { DataFrameAnalyticsConfig firstJob = buildAnalytics(firstJobId, sourceIndex, firstJobDestIndex, null, new Classification(dependentVariable, boostedTreeParams, null, null, 1, 50.0, null, null)); putAnalytics(firstJob); + startAnalytics(firstJobId); + waitUntilAnalyticsIsStopped(firstJobId); String secondJobId = "classification_two_jobs_with_same_randomize_seed_2"; String secondJobDestIndex = secondJobId + "_dest"; @@ -652,11 +654,7 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { new Classification(dependentVariable, boostedTreeParams, null, null, 1, 50.0, randomizeSeed, null)); putAnalytics(secondJob); - - // Let's run both jobs in parallel and wait until they are finished - startAnalytics(firstJobId); startAnalytics(secondJobId); - waitUntilAnalyticsIsStopped(firstJobId); waitUntilAnalyticsIsStopped(secondJobId); // Now we compare they both used the same training rows diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java index bfddfca6cbe..2cee720c0dc 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java @@ -324,7 +324,6 @@ public class RegressionIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertMlResultsFieldMappings(destIndex, predictedClassField, "double"); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/55807") public void testTwoJobsWithSameRandomizeSeedUseSameTrainingSet() throws Exception { String sourceIndex = "regression_two_jobs_with_same_randomize_seed_source"; indexData(sourceIndex, 100, 0); @@ -343,6 +342,8 @@ public class RegressionIT extends MlNativeDataFrameAnalyticsIntegTestCase { DataFrameAnalyticsConfig firstJob = buildAnalytics(firstJobId, sourceIndex, firstJobDestIndex, null, new Regression(DEPENDENT_VARIABLE_FIELD, boostedTreeParams, null, 50.0, null, null, null, null)); putAnalytics(firstJob); + startAnalytics(firstJobId); + waitUntilAnalyticsIsStopped(firstJobId); String secondJobId = "regression_two_jobs_with_same_randomize_seed_2"; String secondJobDestIndex = secondJobId + "_dest"; @@ -352,11 +353,7 @@ public class RegressionIT extends MlNativeDataFrameAnalyticsIntegTestCase { new Regression(DEPENDENT_VARIABLE_FIELD, boostedTreeParams, null, 50.0, randomizeSeed, null, null, null)); putAnalytics(secondJob); - - // Let's run both jobs in parallel and wait until they are finished - startAnalytics(firstJobId); startAnalytics(secondJobId); - waitUntilAnalyticsIsStopped(firstJobId); waitUntilAnalyticsIsStopped(secondJobId); // Now we compare they both used the same training rows