Skip to content

Commit ca47f68

Browse files
author
Christoph Büscher
authored
Ignore type-removal warnings in XPackRestTestHelper (#38431)
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
1 parent 54e684b commit ca47f68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.common.xcontent.XContentHelper;
1515
import org.elasticsearch.common.xcontent.json.JsonXContent;
1616
import org.elasticsearch.test.ESTestCase;
17+
import org.elasticsearch.test.rest.ESRestTestCase;
1718
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
1819
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
1920
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
@@ -76,7 +77,9 @@ public static void waitForTemplates(RestClient client, List<String> templateName
7677
ESTestCase.awaitBusy(() -> {
7778
Map<?, ?> response;
7879
try {
79-
String string = EntityUtils.toString(client.performRequest(new Request("GET", "/_template/" + template)).getEntity());
80+
final Request getRequest = new Request("GET", "_template/" + template);
81+
getRequest.setOptions(ESRestTestCase.allowTypeRemovalWarnings());
82+
String string = EntityUtils.toString(client.performRequest(getRequest).getEntity());
8083
response = XContentHelper.convertToMap(JsonXContent.jsonXContent, string, false);
8184
} catch (ResponseException e) {
8285
if (e.getResponse().getStatusLine().getStatusCode() == 404) {

0 commit comments

Comments
 (0)