Skip to content

Commit f1cf26c

Browse files
committed
Update tests
1 parent cd2e7a6 commit f1cf26c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterQueryWithFiltersIT.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.elasticsearch.client.internal.Client;
1212
import org.elasticsearch.common.Strings;
1313
import org.elasticsearch.common.settings.Settings;
14+
import org.elasticsearch.index.IndexNotFoundException;
1415
import org.elasticsearch.index.query.QueryBuilder;
1516
import org.elasticsearch.index.query.RangeQueryBuilder;
1617
import org.elasticsearch.test.transport.MockTransportService;
@@ -275,13 +276,13 @@ public void testFilterWithMissingIndex() {
275276
);
276277
assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));
277278
// Local index missing + wildcards
278-
// FIXME: planner does not catch this now
279-
// e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close());
280-
// assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));
279+
// FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException
280+
var ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close());
281+
assertThat(ie.getDetailedMessage(), containsString("no such index [missing]"));
281282
// Local index missing + existing index
282-
// FIXME: planner does not catch this now
283-
// e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close());
284-
// assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));
283+
// FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException
284+
ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close());
285+
assertThat(ie.getDetailedMessage(), containsString("no such index [missing]"));
285286
// Local index missing + existing remote
286287
e = expectThrows(VerificationException.class, () -> runQuery("from missing,cluster-a:logs-2", randomBoolean(), filter).close());
287288
assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));

0 commit comments

Comments
 (0)