Skip to content

Commit

Permalink
Fix and unmute CrossClusterEsqlRCS2UnavailableRemotesIT tests (#120402
Browse files Browse the repository at this point in the history
)

* Fix and unmute `CrossClusterEsqlRCS2UnavailableRemotesIT` tests

* [CI] Auto commit changes from spotless

* Fix test

---------

Co-authored-by: elasticsearchmachine <[email protected]>
  • Loading branch information
1 parent 060c833 commit ae7f3b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
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

0 comments on commit ae7f3b6

Please sign in to comment.