Skip to content

Commit

Permalink
[Test] Fix FullClusterRestartIT.testShrink() with copy_settings param (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
tlrx authored Oct 26, 2018
1 parent db12005 commit c42f350
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit c42f350

Please sign in to comment.