Skip to content

Commit

Permalink
[7.10][ML] Increase timeout waiting for DFA jobs to finish in integ t…
Browse files Browse the repository at this point in the history
…ests (#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
  • Loading branch information
dimitris-athanasiou committed Nov 17, 2020
1 parent 93505cc commit 197de8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ protected NamedXContentRegistry xContentRegistry() {
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";
Expand Down Expand Up @@ -242,7 +241,6 @@ public void testWithDatastreams() throws Exception {
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";
Expand Down Expand Up @@ -524,7 +522,7 @@ public void testStopAndRestart() throws Exception {
}
}

waitUntilAnalyticsIsStopped(jobId, TimeValue.timeValueMinutes(1));
waitUntilAnalyticsIsStopped(jobId);

SearchResponse sourceData = client().prepareSearch(sourceIndex).setTrackTotalHits(true).setSize(1000).get();
for (SearchHit hit : sourceData.getHits()) {
Expand Down Expand Up @@ -566,7 +564,6 @@ public void testDependentVariableCardinalityTooHighError() throws Exception {
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);
Expand Down Expand Up @@ -623,7 +620,6 @@ public void testDependentVariableIsAliasToKeyword() throws Exception {
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";
Expand All @@ -642,7 +638,6 @@ public void testDependentVariableIsAliasToNested() throws Exception {
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;
Expand Down Expand Up @@ -687,7 +682,6 @@ public void testTwoJobsWithSameRandomizeSeedUseSameTrainingSet() throws Exceptio
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);
Expand Down Expand Up @@ -785,7 +779,6 @@ public void testDeleteExpiredData_RemovesUnusedState() throws Exception {
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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected StopDataFrameAnalyticsAction.Response forceStopAnalytics(String id) {
}

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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
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;
Expand All @@ -40,7 +39,6 @@

import java.io.IOException;
import java.time.Instant;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -306,7 +304,7 @@ public void testStopAndRestart() throws Exception {
}
}

waitUntilAnalyticsIsStopped(jobId, TimeValue.timeValueMinutes(1));
waitUntilAnalyticsIsStopped(jobId);

SearchResponse sourceData = client().prepareSearch(sourceIndex).setTrackTotalHits(true).setSize(1000).get();
for (SearchHit hit : sourceData.getHits()) {
Expand Down

0 comments on commit 197de8f

Please sign in to comment.