Skip to content

Commit ae7f3b6

Browse files
pawankartik-elasticelasticsearchmachine
andauthored
Fix and unmute CrossClusterEsqlRCS2UnavailableRemotesIT tests (elastic#120402)
* Fix and unmute `CrossClusterEsqlRCS2UnavailableRemotesIT` tests * [CI] Auto commit changes from spotless * Fix test --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent 060c833 commit ae7f3b6

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ tests:
131131
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
132132
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
133133
issue: https://github.com/elastic/elasticsearch/issues/117805
134-
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT
135-
method: testEsqlRcs2UnavailableRemoteScenarios
136-
issue: https://github.com/elastic/elasticsearch/issues/117419
137134
- class: org.elasticsearch.xpack.esql.action.EsqlActionTaskIT
138135
method: testCancelRequestWhenFailingFetchingPages
139136
issue: https://github.com/elastic/elasticsearch/issues/118193

x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/CrossClusterEsqlRCS2UnavailableRemotesIT.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
import java.util.Map;
2626
import java.util.concurrent.atomic.AtomicReference;
2727

28+
import static org.hamcrest.Matchers.anyOf;
2829
import static org.hamcrest.Matchers.containsString;
2930
import static org.hamcrest.Matchers.equalTo;
3031
import static org.hamcrest.Matchers.greaterThan;
3132
import static org.hamcrest.Matchers.is;
33+
import static org.hamcrest.Matchers.oneOf;
3234

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

181183
Map<String, ?> reason = (Map<String, ?>) failuresMap.get("reason");
182-
assertThat(reason.get("type").toString(), equalTo("connect_transport_exception"));
183-
assertThat(reason.get("reason").toString(), containsString("Unable to connect to [my_remote_cluster]"));
184+
assertThat(
185+
reason.get("type").toString(),
186+
oneOf("node_disconnected_exception", "connect_transport_exception", "node_not_connected_exception")
187+
);
184188
} finally {
185189
fulfillingCluster.start();
186190
closeFulfillingClusterClient();
@@ -201,7 +205,14 @@ private void remoteClusterShutdownWithSkipUnavailableFalse() throws Exception {
201205
// A simple query that targets our remote cluster.
202206
String query = "FROM *,my_remote_cluster:* | LIMIT 10";
203207
ResponseException ex = expectThrows(ResponseException.class, () -> performRequestWithRemoteSearchUser(esqlRequest(query)));
204-
assertThat(ex.getMessage(), containsString("connect_transport_exception"));
208+
assertThat(
209+
ex.getMessage(),
210+
anyOf(
211+
containsString("node_disconnected_exception"),
212+
containsString("connect_transport_exception"),
213+
containsString("node_not_connected_exception")
214+
)
215+
);
205216
} finally {
206217
fulfillingCluster.start();
207218
closeFulfillingClusterClient();

0 commit comments

Comments
 (0)