Skip to content

Commit bf57b74

Browse files
committed
[ML] 8.x ML full cluster restart tests can run against old 7.x
There was a mistake in elastic#80876, where the assumption was made that for 8.x versions the old cluster would understand composable templates. This is true for rolling upgrade tests but not full cluster restart tests. This commit fixes that.
1 parent 873553a commit bf57b74

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlConfigIndexMappingsFullClusterRestartIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ protected Settings restClientSettings() {
4343
public void waitForMlTemplates() throws Exception {
4444
// We shouldn't wait for ML templates during the upgrade - production won't
4545
if (isRunningAgainstOldCluster()) {
46-
XPackRestTestHelper.waitForTemplates(client(), XPackRestTestConstants.ML_POST_V7120_TEMPLATES, true);
46+
XPackRestTestHelper.waitForTemplates(
47+
client(),
48+
XPackRestTestConstants.ML_POST_V7120_TEMPLATES,
49+
getOldClusterVersion().onOrAfter(Version.V_7_8_0)
50+
);
4751
}
4852
}
4953

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ protected Settings restClientSettings() {
5858
public void waitForMlTemplates() throws Exception {
5959
// We shouldn't wait for ML templates during the upgrade - production won't
6060
if (isRunningAgainstOldCluster()) {
61-
XPackRestTestHelper.waitForTemplates(client(), XPackRestTestConstants.ML_POST_V7120_TEMPLATES, true);
61+
XPackRestTestHelper.waitForTemplates(
62+
client(),
63+
XPackRestTestConstants.ML_POST_V7120_TEMPLATES,
64+
getOldClusterVersion().onOrAfter(Version.V_7_8_0)
65+
);
6266
}
6367
}
6468

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package org.elasticsearch.xpack.restart;
88

9+
import org.elasticsearch.Version;
910
import org.elasticsearch.client.Request;
1011
import org.elasticsearch.client.Response;
1112
import org.elasticsearch.common.Strings;
@@ -51,7 +52,11 @@ protected Settings restClientSettings() {
5152
public void waitForMlTemplates() throws Exception {
5253
// We shouldn't wait for ML templates during the upgrade - production won't
5354
if (isRunningAgainstOldCluster()) {
54-
XPackRestTestHelper.waitForTemplates(client(), XPackRestTestConstants.ML_POST_V7120_TEMPLATES, true);
55+
XPackRestTestHelper.waitForTemplates(
56+
client(),
57+
XPackRestTestConstants.ML_POST_V7120_TEMPLATES,
58+
getOldClusterVersion().onOrAfter(Version.V_7_8_0)
59+
);
5560
}
5661
}
5762

0 commit comments

Comments
 (0)