Skip to content

Commit c42f350

Browse files
authored
[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.
1 parent db12005 commit c42f350

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ public void testClusterState() throws Exception {
325325

326326
}
327327

328-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/34853")
329328
public void testShrink() throws IOException {
330329
String shrunkenIndex = index + "_shrunk";
331330
int numDocs;
@@ -364,7 +363,9 @@ public void testShrink() throws IOException {
364363
client().performRequest(updateSettingsRequest);
365364

366365
Request shrinkIndexRequest = new Request("PUT", "/" + index + "/_shrink/" + shrunkenIndex);
367-
shrinkIndexRequest.addParameter("copy_settings", "true");
366+
if (getOldClusterVersion().onOrAfter(Version.V_6_4_0)) {
367+
shrinkIndexRequest.addParameter("copy_settings", "true");
368+
}
368369
shrinkIndexRequest.setJsonEntity("{\"settings\": {\"index.number_of_shards\": 1}}");
369370
client().performRequest(shrinkIndexRequest);
370371

0 commit comments

Comments
 (0)