|
9 | 9 |
|
10 | 10 | import org.elasticsearch.ElasticsearchException;
|
11 | 11 | import org.elasticsearch.client.internal.Client;
|
| 12 | +import org.elasticsearch.cluster.RemoteException; |
12 | 13 | import org.elasticsearch.common.Strings;
|
13 | 14 | import org.elasticsearch.common.settings.Settings;
|
| 15 | +import org.elasticsearch.index.IndexNotFoundException; |
14 | 16 | import org.elasticsearch.index.query.QueryBuilder;
|
15 | 17 | import org.elasticsearch.index.query.RangeQueryBuilder;
|
16 | 18 | import org.elasticsearch.test.transport.MockTransportService;
|
@@ -275,13 +277,13 @@ public void testFilterWithMissingIndex() {
|
275 | 277 | );
|
276 | 278 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));
|
277 | 279 | // 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]")); |
| 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]")); |
281 | 283 | // 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]")); |
| 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]")); |
285 | 287 | // Local index missing + existing remote
|
286 | 288 | e = expectThrows(VerificationException.class, () -> runQuery("from missing,cluster-a:logs-2", randomBoolean(), filter).close());
|
287 | 289 | assertThat(e.getDetailedMessage(), containsString("Unknown index [missing]"));
|
@@ -318,15 +320,19 @@ public void testFilterWithMissingRemoteIndex() {
|
318 | 320 | );
|
319 | 321 | assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:missing]"));
|
320 | 322 | // Local index missing + wildcards
|
321 |
| - // FIXME: planner does not catch this now |
322 |
| - // e = expectThrows(VerificationException.class, () -> runQuery("from cluster-a:missing,cluster-a:logs*", randomBoolean(), |
323 |
| - // filter).close()); |
324 |
| - // assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:missing]")); |
| 323 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime RemoteException |
| 324 | + var ie = expectThrows( |
| 325 | + RemoteException.class, |
| 326 | + () -> runQuery("from cluster-a:missing,cluster-a:logs*", randomBoolean(), filter).close() |
| 327 | + ); |
| 328 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
325 | 329 | // Local index missing + existing index
|
326 |
| - // FIXME: planner does not catch this now |
327 |
| - // e = expectThrows(VerificationException.class, () -> runQuery("from cluster-a:missing,cluster-a:logs-2", randomBoolean(), |
328 |
| - // filter).close()); |
329 |
| - // assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:missing]")); |
| 330 | + // FIXME: planner does not catch this now, it should be VerificationException but for now it's runtime RemoteException |
| 331 | + ie = expectThrows( |
| 332 | + RemoteException.class, |
| 333 | + () -> runQuery("from cluster-a:missing,cluster-a:logs-2", randomBoolean(), filter).close() |
| 334 | + ); |
| 335 | + assertThat(ie.getDetailedMessage(), containsString("no such index [missing]")); |
330 | 336 | // Local index + missing remote
|
331 | 337 | e = expectThrows(VerificationException.class, () -> runQuery("from logs-1,cluster-a:missing", randomBoolean(), filter).close());
|
332 | 338 | assertThat(e.getDetailedMessage(), containsString("Unknown index [cluster-a:missing]"));
|
|
0 commit comments