Skip to content

Commit 85b2437

Browse files
authored
Added ESQL skip_unavailable testing for non-matching index expressions under RCS2 (elastic#116846) (elastic#117181)
Cherry-pick backport of from 286c4bb From PR elastic#116846
1 parent 99c0868 commit 85b2437

File tree

2 files changed

+524
-9
lines changed

2 files changed

+524
-9
lines changed

x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/CrossClusterEsqlRCS1MissingIndicesIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class CrossClusterEsqlRCS1MissingIndicesIT extends AbstractRemoteClusterS
7676
record ExpectedCluster(String clusterAlias, String indexExpression, String status, Integer totalShards) {}
7777

7878
@SuppressWarnings("unchecked")
79-
public void assertExpectedClustersForMissingIndicesTests(Map<String, Object> responseMap, List<ExpectedCluster> expected) {
79+
void assertExpectedClustersForMissingIndicesTests(Map<String, Object> responseMap, List<ExpectedCluster> expected) {
8080
Map<String, ?> clusters = (Map<String, ?>) responseMap.get("_clusters");
8181
assertThat((int) responseMap.get("took"), greaterThan(0));
8282

@@ -220,7 +220,7 @@ public void testSearchesAgainstNonMatchingIndicesWithSkipUnavailableTrue() throw
220220
);
221221
}
222222

223-
// since at least one index of the query matches on some cluster, a wildcarded index on skip_un=true is not an error
223+
// since at least one index of the query matches on some cluster, a missing wildcarded index on skip_un=true is not an error
224224
{
225225
String q = Strings.format("FROM %s,%s:nomatch*", INDEX1, REMOTE_CLUSTER_ALIAS);
226226

@@ -358,7 +358,7 @@ public void testSearchesAgainstNonMatchingIndicesWithSkipUnavailableFalse() thro
358358

359359
String limit0 = q + " | LIMIT 0";
360360
e = expectThrows(ResponseException.class, () -> client().performRequest(esqlRequest(limit0)));
361-
assertThat(e.getMessage(), Matchers.containsString("Unknown index [nomatch]"));
361+
assertThat(e.getMessage(), containsString("Unknown index [nomatch]"));
362362
}
363363

364364
// missing concrete remote index is not fatal when skip_unavailable=true (as long as an index matches on another cluster)
@@ -371,7 +371,7 @@ public void testSearchesAgainstNonMatchingIndicesWithSkipUnavailableFalse() thro
371371

372372
String limit0 = q + " | LIMIT 0";
373373
e = expectThrows(ResponseException.class, () -> client().performRequest(esqlRequest(limit0)));
374-
assertThat(e.getMessage(), Matchers.containsString(Strings.format("Unknown index [%s:nomatch]", REMOTE_CLUSTER_ALIAS)));
374+
assertThat(e.getMessage(), containsString(Strings.format("Unknown index [%s:nomatch]", REMOTE_CLUSTER_ALIAS)));
375375
}
376376

377377
// since there is at least one matching index in the query, the missing wildcarded local index is not an error

0 commit comments

Comments
 (0)