|
12 | 12 | import org.elasticsearch.cluster.RemoteException; |
13 | 13 | import org.elasticsearch.common.Strings; |
14 | 14 | import org.elasticsearch.common.settings.Settings; |
| 15 | +import org.elasticsearch.index.IndexNotFoundException; |
15 | 16 | import org.elasticsearch.index.query.QueryBuilder; |
16 | 17 | import org.elasticsearch.index.query.RangeQueryBuilder; |
17 | 18 | import org.elasticsearch.test.transport.MockTransportService; |
@@ -276,13 +277,13 @@ public void testFilterWithMissingIndex() { |
276 | 277 | ); |
277 | 278 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
278 | 279 | // Local index missing + wildcards |
279 | | - // FIXME: planner does not catch this now |
280 | | - // e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close()); |
281 | | - // assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
| 280 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException |
| 281 | + var ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs*", randomBoolean(), filter).close()); |
| 282 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
282 | 283 | // Local index missing + existing index |
283 | | - // FIXME: planner does not catch this now |
284 | | - // e = expectThrows(VerificationException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close()); |
285 | | - // assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
| 284 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime IndexNotFoundException |
| 285 | + ie = expectThrows(IndexNotFoundException.class, () -> runQuery("from missing,logs-1", randomBoolean(), filter).close()); |
| 286 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
286 | 287 | // Local index missing + existing remote |
287 | 288 | e = expectThrows(VerificationException.class, () -> runQuery("from missing,cluster-a:logs-2", randomBoolean(), filter).close()); |
288 | 289 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]")); |
|
0 commit comments