Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RequestIndexFilteringIT::testIndicesDontExist #120899

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/120810
- class: org.elasticsearch.indices.mapping.UpdateMappingIntegrationIT
issue: https://github.com/elastic/elasticsearch/issues/116126
- class: org.elasticsearch.xpack.esql.ccq.RequestIndexFilteringIT
method: testIndicesDontExist
issue: https://github.com/elastic/elasticsearch/issues/120889
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/140_data_stream_aliases/Create data stream aliases using wildcard expression}
issue: https://github.com/elastic/elasticsearch/issues/120890
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.transport.RemoteClusterAware;
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.xpack.esql.AssertWarnings;
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
Expand Down Expand Up @@ -212,13 +213,20 @@ public void testIndicesDontExist() throws IOException {
assertThat(e.getMessage(), anyOf(containsString("no such index [foo]"), containsString("no such index [remote_cluster:foo]")));

if (EsqlCapabilities.Cap.JOIN_LOOKUP_V12.isEnabled()) {
var pattern = from("test1");
e = expectThrows(
ResponseException.class,
() -> runEsql(timestampFilter("gte", "2020-01-01").query(from("test1") + " | LOOKUP JOIN foo ON id1"))
() -> runEsql(timestampFilter("gte", "2020-01-01").query(pattern + " | LOOKUP JOIN foo ON id1"))
);
assertEquals(400, e.getResponse().getStatusLine().getStatusCode());
assertThat(e.getMessage(), containsString("verification_exception"));
assertThat(e.getMessage(), containsString("Unknown index [foo]"));
assertThat(
e.getMessage(),
// currently we don't support remote clusters in LOOKUP JOIN
// this check happens before resolving actual indices and results in a different error message
RemoteClusterAware.isRemoteIndexName(pattern)
alex-spies marked this conversation as resolved.
Show resolved Hide resolved
? allOf(containsString("parsing_exception"), containsString("remote clusters are not supported in LOOKUP JOIN"))
: allOf(containsString("verification_exception"), containsString("Unknown index [foo]"))
);
}
}

Expand Down