diff --git a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java index c04c14169a71b..e3c4dad12b7c4 100644 --- a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java +++ b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java @@ -282,8 +282,7 @@ public void testCancelUnnecessaryRequests() { query.query("from test-* | LIMIT 1"); query.pragmas(new QueryPragmas(Settings.builder().put(QueryPragmas.MAX_CONCURRENT_NODES_PER_CLUSTER.getKey(), 1).build())); - try { - var result = safeExecute(client(coordinatingNode), EsqlQueryAction.INSTANCE, query); + try (var result = safeGet(client().execute(EsqlQueryAction.INSTANCE, query))) { assertThat(Iterables.size(result.rows()), equalTo(1L)); assertThat(exchanges.get(), lessThanOrEqualTo(1));// 0 if result is populated from coordinating node } catch (AssertionError e) {