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 and unmute CrossClusterEsqlRCS2UnavailableRemotesIT tests #120402

3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ tests:
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
issue: https://github.com/elastic/elasticsearch/issues/117805
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT
method: testEsqlRcs2UnavailableRemoteScenarios
issue: https://github.com/elastic/elasticsearch/issues/117419
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
method: testCancelRequestWhenFailingFetchingPages
issue: https://github.com/elastic/elasticsearch/issues/118193
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.oneOf;

public class CrossClusterEsqlRCS2UnavailableRemotesIT extends AbstractRemoteClusterSecurityTestCase {
private static final AtomicReference<Map<String, Object>> API_KEY_MAP_REF = new AtomicReference<>();
Expand Down Expand Up @@ -179,8 +181,10 @@ private void remoteClusterShutdownWithSkipUnavailableTrue() throws Exception {
Map<String, ?> failuresMap = (Map<String, ?>) remoteClusterFailures.get(0);

Map<String, ?> reason = (Map<String, ?>) failuresMap.get("reason");
assertThat(reason.get("type").toString(), equalTo("connect_transport_exception"));
assertThat(reason.get("reason").toString(), containsString("Unable to connect to [my_remote_cluster]"));
assertThat(
reason.get("type").toString(),
oneOf("node_disconnected_exception", "connect_transport_exception", "node_not_connected_exception")
);
} finally {
fulfillingCluster.start();
closeFulfillingClusterClient();
Expand All @@ -201,7 +205,14 @@ private void remoteClusterShutdownWithSkipUnavailableFalse() throws Exception {
// A simple query that targets our remote cluster.
String query = "FROM *,my_remote_cluster:* | LIMIT 10";
ResponseException ex = expectThrows(ResponseException.class, () -> performRequestWithRemoteSearchUser(esqlRequest(query)));
assertThat(ex.getMessage(), containsString("connect_transport_exception"));
assertThat(
ex.getMessage(),
anyOf(
containsString("node_disconnected_exception"),
containsString("connect_transport_exception"),
containsString("node_not_connected_exception")
)
);
} finally {
fulfillingCluster.start();
closeFulfillingClusterClient();
Expand Down