From a36efe9f9ad781ed4cadc311295b27a271b6ddd5 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Fri, 26 Oct 2018 12:57:31 +0200 Subject: [PATCH] [Test] Fix FullClusterRestartIT.testShrink() with copy_settings param (#34853) The pull request #34338 added strict deprecation mode to the REST tests and adds the copy_settings param when testing the shrink of an index. This parameter has been added in 6.4.0 and will be removed in 8.0, so the test now needs to take care of the old cluster version when adding the copy_settings param. --- .../org/elasticsearch/upgrades/FullClusterRestartIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java index 6f878d24c871a..d26dc2029f6cf 100644 --- a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java @@ -325,7 +325,6 @@ public void testClusterState() throws Exception { } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/34853") public void testShrink() throws IOException { String shrunkenIndex = index + "_shrunk"; int numDocs; @@ -364,7 +363,9 @@ public void testShrink() throws IOException { client().performRequest(updateSettingsRequest); Request shrinkIndexRequest = new Request("PUT", "/" + index + "/_shrink/" + shrunkenIndex); - shrinkIndexRequest.addParameter("copy_settings", "true"); + if (getOldClusterVersion().onOrAfter(Version.V_6_4_0)) { + shrinkIndexRequest.addParameter("copy_settings", "true"); + } shrinkIndexRequest.setJsonEntity("{\"settings\": {\"index.number_of_shards\": 1}}"); client().performRequest(shrinkIndexRequest);