From 197de8fe66a7505e590c0a76464d99d8f8db3ecc Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Tue, 17 Nov 2020 16:46:17 +0200 Subject: [PATCH] [7.10][ML] Increase timeout waiting for DFA jobs to finish in integ tests (#65126) (#65131) It appears that occasionally 30 seconds are not enough for CI workers to complete DFA jobs. In order to eliminate such failures we increase the time we wait for DFA jobs to complete in integration tests to 60 seconds. Fixes #64926 Backport of #65126 --- .../xpack/ml/integration/ClassificationIT.java | 9 +-------- .../MlNativeDataFrameAnalyticsIntegTestCase.java | 2 +- .../elasticsearch/xpack/ml/integration/RegressionIT.java | 6 ++---- 3 files changed, 4 insertions(+), 13 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 531a3990afa..0a9ce35b045 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 @@ -129,7 +129,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { return new NamedXContentRegistry(entries); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testSingleNumericFeatureAndMixedTrainingAndNonTrainingRows() throws Exception { initialize("classification_single_numeric_feature_and_mixed_data_set"); String predictedClassField = KEYWORD_FIELD + "_prediction"; @@ -242,7 +241,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertEvaluation(KEYWORD_FIELD, KEYWORD_FIELD_VALUES, "ml." + predictedClassField); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testWithOnlyTrainingRowsAndTrainingPercentIsHundred() throws Exception { initialize("classification_only_training_data_and_training_percent_is_100"); String predictedClassField = KEYWORD_FIELD + "_prediction"; @@ -524,7 +522,7 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { } } - waitUntilAnalyticsIsStopped(jobId, TimeValue.timeValueMinutes(1)); + waitUntilAnalyticsIsStopped(jobId); SearchResponse sourceData = client().prepareSearch(sourceIndex).setTrackTotalHits(true).setSize(1000).get(); for (SearchHit hit : sourceData.getHits()) { @@ -566,7 +564,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertThat(e.getMessage(), equalTo("Field [keyword-field] must have at most [30] distinct values but there were at least [31]")); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testDependentVariableCardinalityTooHighButWithQueryMakesItWithinRange() throws Exception { initialize("cardinality_too_high_with_query"); indexData(sourceIndex, 6, 5, KEYWORD_FIELD); @@ -623,7 +620,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertEvaluation(ALIAS_TO_KEYWORD_FIELD, KEYWORD_FIELD_VALUES, "ml." + predictedClassField); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testDependentVariableIsAliasToNested() throws Exception { initialize("dependent_variable_is_alias_to_nested"); String predictedClassField = ALIAS_TO_NESTED_FIELD + "_prediction"; @@ -642,7 +638,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertEvaluation(ALIAS_TO_NESTED_FIELD, KEYWORD_FIELD_VALUES, "ml." + predictedClassField); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testTwoJobsWithSameRandomizeSeedUseSameTrainingSet() throws Exception { String sourceIndex = "classification_two_jobs_with_same_randomize_seed_source"; String dependentVariable = KEYWORD_FIELD; @@ -687,7 +682,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertThat(secondRunTrainingRowsIds, equalTo(firstRunTrainingRowsIds)); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testSetUpgradeMode_ExistingTaskGetsUnassigned() throws Exception { initialize("classification_set_upgrade_mode"); indexData(sourceIndex, 300, 0, KEYWORD_FIELD); @@ -785,7 +779,6 @@ public class ClassificationIT extends MlNativeDataFrameAnalyticsIntegTestCase { assertThat(stateIndexSearchResponse.getHits().getTotalHits().value, equalTo(0L)); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926") public void testUpdateAnalytics() throws Exception { initialize("update_analytics_description"); diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeDataFrameAnalyticsIntegTestCase.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeDataFrameAnalyticsIntegTestCase.java index fdfc2edaba8..9fbbe822584 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeDataFrameAnalyticsIntegTestCase.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeDataFrameAnalyticsIntegTestCase.java @@ -149,7 +149,7 @@ abstract class MlNativeDataFrameAnalyticsIntegTestCase extends MlNativeIntegTest } protected void waitUntilAnalyticsIsStopped(String id) throws Exception { - waitUntilAnalyticsIsStopped(id, TimeValue.timeValueSeconds(30)); + waitUntilAnalyticsIsStopped(id, TimeValue.timeValueSeconds(60)); } protected void waitUntilAnalyticsIsStopped(String id, TimeValue waitTime) throws Exception { 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 3ed7aff974f..53277a92970 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 @@ -15,9 +15,8 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchModule; @@ -40,7 +39,6 @@ import org.junit.After; import java.io.IOException; import java.time.Instant; -import java.util.Arrays; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -306,7 +304,7 @@ public class RegressionIT extends MlNativeDataFrameAnalyticsIntegTestCase { } } - waitUntilAnalyticsIsStopped(jobId, TimeValue.timeValueMinutes(1)); + waitUntilAnalyticsIsStopped(jobId); SearchResponse sourceData = client().prepareSearch(sourceIndex).setTrackTotalHits(true).setSize(1000).get(); for (SearchHit hit : sourceData.getHits()) {