From 58ebe329d27f5c462d95fbd61ee22999788f38c8 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Thu, 25 Oct 2018 13:35:06 +0200 Subject: [PATCH 1/2] [Test] Fix FullClusterRestartIT.testShrink() with copy_settings param 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. --- .../java/org/elasticsearch/upgrades/FullClusterRestartIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..038d9dd962dba 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 @@ -364,7 +364,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); From 99a612697946159003bf4027f7ca84598aed081a Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Thu, 25 Oct 2018 16:56:02 +0200 Subject: [PATCH 2/2] Unmute test --- .../java/org/elasticsearch/upgrades/FullClusterRestartIT.java | 1 - 1 file changed, 1 deletion(-) 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 038d9dd962dba..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;