Skip to content

Commit

Permalink
Ignore type-removal warnings in XPackRestTestHelper (#38431)
Browse files Browse the repository at this point in the history
The backport of #38022 introduced types-deprecation warning for get/put template requests
that cause problems on tests master in mixed cluster scenarios. While these warnings are
caught and ignored in regular Rest tests, the get template requests in XPackRestTestHelper
were missed.

Closes #38412
  • Loading branch information
Christoph Büscher authored Feb 5, 2019
1 parent 54e684b commit ca47f68
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
Expand Down Expand Up @@ -76,7 +77,9 @@ public static void waitForTemplates(RestClient client, List<String> templateName
ESTestCase.awaitBusy(() -> {
Map<?, ?> response;
try {
String string = EntityUtils.toString(client.performRequest(new Request("GET", "/_template/" + template)).getEntity());
final Request getRequest = new Request("GET", "_template/" + template);
getRequest.setOptions(ESRestTestCase.allowTypeRemovalWarnings());
String string = EntityUtils.toString(client.performRequest(getRequest).getEntity());
response = XContentHelper.convertToMap(JsonXContent.jsonXContent, string, false);
} catch (ResponseException e) {
if (e.getResponse().getStatusLine().getStatusCode() == 404) {
Expand Down

0 comments on commit ca47f68

Please sign in to comment.