Skip to content

Commit 1e6234f

Browse files
testThatRemoteErrorsAreWrapped: use try to close query response
1 parent 0b06d9f commit 1e6234f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,6 @@ tests:
543543
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
544544
method: testStopQueryLocal
545545
issue: https://github.com/elastic/elasticsearch/issues/121672
546-
- class: org.elasticsearch.xpack.esql.action.EsqlRemoteErrorWrapIT
547-
method: testThatRemoteErrorsAreWrapped
548-
issue: https://github.com/elastic/elasticsearch/issues/130794
549546
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
550547
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
551548
issue: https://github.com/elastic/elasticsearch/issues/122414

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlRemoteErrorWrapIT.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ public void testThatRemoteErrorsAreWrapped() throws Exception {
3434
);
3535
}
3636

37-
RemoteException wrappedError = expectThrows(
38-
RemoteException.class,
39-
() -> runQuery("FROM " + REMOTE_CLUSTER_1 + ":*," + REMOTE_CLUSTER_2 + ":* | LIMIT 100", false)
40-
);
37+
RemoteException wrappedError = expectThrows(RemoteException.class, () -> {
38+
try (EsqlQueryResponse ignored = runQuery("FROM " + REMOTE_CLUSTER_1 + ":*," + REMOTE_CLUSTER_2 + ":* | LIMIT 100", false)) {}
39+
});
4140
assertThat(wrappedError.getMessage(), is("Remote [cluster-a] encountered an error"));
4241
}
4342
}

0 commit comments

Comments
 (0)