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 eaf3a8df3436d..08d59eade600e 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 @@ -281,8 +281,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(2)); } finally {