Skip to content

Commit a049858

Browse files
Fix UT fail
1 parent 516ed37 commit a049858

File tree

1 file changed

+7
-3
lines changed
  • x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq

1 file changed

+7
-3
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public void testLikeIndex() throws Exception {
433433
}
434434

435435
// the feature is completely supported if both local and remote clusters support it
436-
assumeTrue("not supported", clusterHasCapability("POST", "/_query", List.of(), List.of("like_on_index_fields")).orElse(false));
436+
assumeTrue("not supported", capabilitiesSupportedNewAndOld(List.of("like_on_index_fields")));
437437
try (
438438
ClusterSettingToggle ignored = new ClusterSettingToggle(adminClient(), "esql.query.string_like_on_index", false, true);
439439
RestClient remoteClient = remoteClusterClient();
@@ -458,8 +458,12 @@ public void testLikeIndexLegacySettingResults() throws Exception {
458458
// we require that the admin client supports the like_on_index_fields capability
459459
// otherwise we will get an error when trying to toggle the setting
460460
// the remote client does not have to support it
461-
assumeTrue("not supported", clusterHasCapability("POST", "/_query", List.of(), List.of("like_on_index_fields")).orElse(false));
462-
try (ClusterSettingToggle ignored = new ClusterSettingToggle(adminClient(), "esql.query.string_like_on_index", false, true)) {
461+
assumeTrue("not supported", capabilitiesSupportedNewAndOld(List.of("like_on_index_fields")));
462+
try (
463+
ClusterSettingToggle ignored = new ClusterSettingToggle(adminClient(), "esql.query.string_like_on_index", false, true);
464+
RestClient remoteClient = remoteClusterClient();
465+
ClusterSettingToggle ignored2 = new ClusterSettingToggle(remoteClient, "esql.query.string_like_on_index", false, true)
466+
) {
463467
boolean includeCCSMetadata = includeCCSMetadata();
464468
Map<String, Object> result = run("""
465469
FROM test-local-index,*:test-remote-index METADATA _index

0 commit comments

Comments
 (0)