Skip to content

Commit eec6f7c

Browse files
authored
[ML] Fix skipping ML upgrade tests on incompatible versions of Linux (#131681) (#133634)
1 parent 06799ea commit eec6f7c

File tree

6 files changed

+39
-7
lines changed

6 files changed

+39
-7
lines changed

x-pack/qa/full-cluster-restart/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.elasticsearch.gradle.internal.BwcVersions
12
import org.elasticsearch.gradle.internal.info.BuildParams
23
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
34

@@ -20,5 +21,10 @@ buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
2021
usesBwcDistribution(bwcVersion)
2122
systemProperty("tests.old_cluster_version", bwcVersion)
2223
maxParallelForks = 1
24+
25+
// Disable ML tests for incompatible systems
26+
if (BwcVersions.isMlCompatible(bwcVersion) == false) {
27+
systemProperty 'tests.ml.skip', 'true'
28+
}
2329
}
2430
}

x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MLModelDeploymentFullClusterRestartIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import static org.hamcrest.Matchers.equalTo;
3737
import static org.hamcrest.Matchers.hasSize;
3838

39-
public class MLModelDeploymentFullClusterRestartIT extends AbstractXpackFullClusterRestartTestCase {
39+
public class MLModelDeploymentFullClusterRestartIT extends MlFullClusterRestartTestCase {
4040

4141
// See PyTorchModelIT for how this model was created
4242
static final String BASE_64_ENCODED_MODEL =
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
package org.elasticsearch.xpack.restart;
9+
10+
import org.elasticsearch.core.Booleans;
11+
import org.elasticsearch.upgrades.FullClusterRestartUpgradeStatus;
12+
import org.junit.BeforeClass;
13+
14+
public abstract class MlFullClusterRestartTestCase extends AbstractXpackFullClusterRestartTestCase {
15+
16+
protected static final boolean SKIP_ML_TESTS = Booleans.parseBoolean(System.getProperty("tests.ml.skip", "false"));
17+
18+
public MlFullClusterRestartTestCase(FullClusterRestartUpgradeStatus upgradeStatus) {
19+
super(upgradeStatus);
20+
}
21+
22+
@BeforeClass
23+
public static void maybeSkip() {
24+
assumeFalse("Skip ML tests on unsupported glibc versions", SKIP_ML_TESTS);
25+
}
26+
}

x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import static org.hamcrest.Matchers.notNullValue;
4141
import static org.hamcrest.Matchers.nullValue;
4242

43-
public class MlHiddenIndicesFullClusterRestartIT extends AbstractXpackFullClusterRestartTestCase {
43+
public class MlHiddenIndicesFullClusterRestartIT extends MlFullClusterRestartTestCase {
4444

4545
private static final String JOB_ID = "ml-hidden-indices-old-cluster-job";
4646
private static final List<Tuple<List<String>, String>> EXPECTED_INDEX_ALIAS_PAIRS = List.of(

x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MlMigrationFullClusterRestartIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import static org.hamcrest.Matchers.emptyOrNullString;
3838
import static org.hamcrest.Matchers.is;
3939

40-
public class MlMigrationFullClusterRestartIT extends AbstractXpackFullClusterRestartTestCase {
40+
public class MlMigrationFullClusterRestartIT extends MlFullClusterRestartTestCase {
4141

4242
private static final String OLD_CLUSTER_OPEN_JOB_ID = "migration-old-cluster-open-job";
4343
private static final String OLD_CLUSTER_STARTED_DATAFEED_ID = "migration-old-cluster-started-datafeed";

x-pack/qa/rolling-upgrade/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
137137
// Disable ML tests for incompatible systems
138138
if (BwcVersions.isMlCompatible(bwcVersion) == false) {
139139
systemProperty 'tests.ml.skip', 'true'
140-
systemProperty 'tests.rest.blacklist', ['old_cluster/30_ml_jobs_crud/*', 'old_cluster/40_ml_datafeed_crud/*', 'old_cluster/90_ml_data_frame_analytics_crud'].join(',')
140+
systemProperty 'tests.rest.blacklist', ['old_cluster/30_ml_jobs_crud/*', 'old_cluster/40_ml_datafeed_crud/*', 'old_cluster/90_ml_data_frame_analytics_crud/*'].join(',')
141141
}
142142
}
143143

@@ -173,7 +173,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
173173
// Disable ML tests for incompatible systems
174174
if (BwcVersions.isMlCompatible(bwcVersion) == false) {
175175
systemProperty 'tests.ml.skip', 'true'
176-
excludeList.addAll(['mixed_cluster/30_ml_jobs_crud/*', 'mixed_cluster/40_ml_datafeed_crud/*', 'mixed_cluster/90_ml_data_frame_analytics_crud'])
176+
excludeList.addAll(['mixed_cluster/30_ml_jobs_crud/*', 'mixed_cluster/40_ml_datafeed_crud/*', 'mixed_cluster/90_ml_data_frame_analytics_crud/*'])
177177
}
178178
systemProperty 'tests.rest.blacklist', excludeList.join(',')
179179
}
@@ -194,7 +194,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
194194
// Disable ML tests for incompatible systems
195195
if (BwcVersions.isMlCompatible(bwcVersion) == false) {
196196
systemProperty 'tests.ml.skip', 'true'
197-
systemProperty 'tests.rest.blacklist', ['mixed_cluster/30_ml_jobs_crud/*', 'mixed_cluster/40_ml_datafeed_crud/*', 'mixed_cluster/90_ml_data_frame_analytics_crud'].join(',')
197+
systemProperty 'tests.rest.blacklist', ['mixed_cluster/30_ml_jobs_crud/*', 'mixed_cluster/40_ml_datafeed_crud/*', 'mixed_cluster/90_ml_data_frame_analytics_crud/*'].join(',')
198198
}
199199
}
200200

@@ -213,7 +213,7 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
213213
// Disable ML tests for incompatible systems
214214
if (BwcVersions.isMlCompatible(bwcVersion) == false) {
215215
systemProperty 'tests.ml.skip', 'true'
216-
systemProperty 'tests.rest.blacklist', ['upgraded_cluster/30_ml_jobs_crud/*', 'upgraded_cluster/40_ml_datafeed_crud/*', 'upgraded_cluster/90_ml_data_frame_analytics_crud'].join(',')
216+
systemProperty 'tests.rest.blacklist', ['upgraded_cluster/30_ml_jobs_crud/*', 'upgraded_cluster/40_ml_datafeed_crud/*', 'upgraded_cluster/90_ml_data_frame_analytics_crud/*'].join(',')
217217
}
218218
}
219219

0 commit comments

Comments
 (0)