[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.
This commit is contained in:
parent
db12005674
commit
c42f350a81
|
@ -325,7 +325,6 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/34853")
|
|
||||||
public void testShrink() throws IOException {
|
public void testShrink() throws IOException {
|
||||||
String shrunkenIndex = index + "_shrunk";
|
String shrunkenIndex = index + "_shrunk";
|
||||||
int numDocs;
|
int numDocs;
|
||||||
|
@ -364,7 +363,9 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
||||||
client().performRequest(updateSettingsRequest);
|
client().performRequest(updateSettingsRequest);
|
||||||
|
|
||||||
Request shrinkIndexRequest = new Request("PUT", "/" + index + "/_shrink/" + shrunkenIndex);
|
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}}");
|
shrinkIndexRequest.setJsonEntity("{\"settings\": {\"index.number_of_shards\": 1}}");
|
||||||
client().performRequest(shrinkIndexRequest);
|
client().performRequest(shrinkIndexRequest);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue