Skip to content

Commit

Permalink
[ML] Increase timeout waiting for DFA jobs to finish in integ tests (e…
Browse files Browse the repository at this point in the history
…lastic#65126)

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 elastic#64926
  • Loading branch information
dimitris-athanasiou authored Nov 17, 2020
1 parent b7bebfd commit 978fd51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,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 @@ -241,7 +240,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 @@ -479,7 +477,6 @@ public void testWithOnlyTrainingRowsAndTrainingPercentIsFifty_DependentVariableI
"classification_training_percent_is_50_text_and_keyword", TEXT_FIELD + ".keyword", KEYWORD_FIELD_VALUES, "keyword");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/64926")
public void testWithOnlyTrainingRowsAndTrainingPercentIsFifty_DependentVariableIsBoolean() throws Exception {
testWithOnlyTrainingRowsAndTrainingPercentIsFifty(
"classification_training_percent_is_50_boolean", BOOLEAN_FIELD, BOOLEAN_FIELD_VALUES, "boolean");
Expand Down Expand Up @@ -524,7 +521,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 +563,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 +619,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 +637,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 +681,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 +778,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 @@ -330,7 +330,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 @@ -571,9 +571,7 @@ public void testAliasFields() throws Exception {

startAnalytics(jobId);

// This seems to some times take a bit longer than 30 seconds on CI
// so we give it a minute.
waitUntilAnalyticsIsStopped(jobId, TimeValue.timeValueMinutes(1));
waitUntilAnalyticsIsStopped(jobId);

double predictionErrorSum = 0.0;

Expand Down

0 comments on commit 978fd51

Please sign in to comment.