Skip to content

Commit 0afe31a

Browse files
Fix UT fail
1 parent 0996c39 commit 0afe31a

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
@@ -432,7 +432,7 @@ public void testLikeIndex() throws Exception {
432432

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

0 commit comments

Comments
 (0)