Skip to content

Commit cdb1f59

Browse files
committed
permit warnings. revert change for searchable snapshots
1 parent 42931a3 commit cdb1f59

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
package org.elasticsearch.test.rest;
1111

12-
import io.netty.handler.codec.http.HttpMethod;
13-
1412
import org.apache.http.Header;
1513
import org.apache.http.HttpEntity;
1614
import org.apache.http.HttpHost;
@@ -147,6 +145,8 @@
147145
import static org.hamcrest.Matchers.in;
148146
import static org.hamcrest.Matchers.notNullValue;
149147

148+
import io.netty.handler.codec.http.HttpMethod;
149+
150150
/**
151151
* Superclass for tests that interact with an external test cluster using Elasticsearch's {@link RestClient}.
152152
*/
@@ -427,14 +427,12 @@ public void initClient() throws IOException {
427427
assert semanticNodeVersions.isEmpty() == false || serverless;
428428

429429
if (multiProjectPluginVariant != null) {
430-
final var response = entityAsMap(
431-
adminClient.performRequest(
432-
new Request(
433-
"GET",
434-
"/_cluster/settings?include_defaults&filter_path=*." + multiProjectPluginVariant + ".multi_project.enabled"
435-
)
436-
)
430+
final Request settingRequest = new Request(
431+
"GET",
432+
"/_cluster/settings?include_defaults&filter_path=*." + multiProjectPluginVariant + ".multi_project.enabled"
437433
);
434+
settingRequest.setOptions(RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE));
435+
final var response = entityAsMap(adminClient.performRequest(settingRequest));
438436
multiProjectEnabled = Boolean.parseBoolean(
439437
ObjectPath.evaluate(response, "defaults." + multiProjectPluginVariant + ".multi_project.enabled")
440438
);
@@ -1291,9 +1289,6 @@ protected void wipeSearchableSnapshotsIndices() throws IOException {
12911289
// retrieves all indices with a type of store equals to "snapshot"
12921290
final Request request = new Request("GET", "_cluster/state/metadata");
12931291
request.addParameter("filter_path", "metadata.indices.*.settings.index.store.snapshot");
1294-
if (multiProjectEnabled) {
1295-
request.addParameter("multi_project", "true");
1296-
}
12971292

12981293
final Response response = cleanupClient().performRequest(request);
12991294
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)