Skip to content

Commit ef59b3d

Browse files
committed
Add capabilities check for rest test
1 parent 0ac116e commit ef59b3d

File tree

1 file changed

+5
-1
lines changed
  • x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq

1 file changed

+5
-1
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ public void testIndexPattern() throws Exception {
400400

401401
@SuppressWarnings("unchecked")
402402
public void testStats() throws IOException {
403-
assumeTrue("Older versions do not have ESQL stats", Clusters.localClusterVersion().onOrAfter(Version.V_8_18_0));
403+
Request caps = new Request("GET", "_capabilities?method=GET&path=_cluster/stats&capabilities=esql-stats");
404+
Response capsResponse = client().performRequest(caps);
405+
Map<String, Object> capsResult = entityAsMap(capsResponse.getEntity());
406+
assumeTrue("esql stats capability missing", capsResult.get("supported").equals(true));
407+
404408
run("FROM test-local-index,*:test-remote-index | STATS total = SUM(data) BY color | SORT color", includeCCSMetadata());
405409
Request stats = new Request("GET", "_cluster/stats");
406410
Response statsResponse = client().performRequest(stats);

0 commit comments

Comments
 (0)