From e01079363a67dfd5d1f546546d08ff4d42ec1556 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 6 Oct 2023 19:27:16 +0100 Subject: [PATCH] Avoid resetting feature states before 7.13.0 (#100423) This API was introduced in 7.13.0, we cannot call it on earlier nodes. --- .../java/org/elasticsearch/test/rest/ESRestTestCase.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java index 9a3c03810c943..4e769881c39a0 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java @@ -561,8 +561,14 @@ protected boolean preserveTemplatesUponCompletion() { */ protected boolean resetFeatureStates() { try { + final Version minimumNodeVersion = minimumNodeVersion(); + // Reset feature state API was introduced in 7.13.0 + if (minimumNodeVersion.before(Version.V_7_13_0)) { + return false; + } + // ML reset fails when ML is disabled in versions before 8.7 - if (isMlEnabled() == false && minimumNodeVersion().before(Version.V_8_7_0)) { + if (isMlEnabled() == false && minimumNodeVersion.before(Version.V_8_7_0)) { return false; } } catch (IOException e) {