Skip to content

Commit b270941

Browse files
committed
Fix MultiClustersIT#testStats (elastic#119494)
This test depends on `/_capabilities` endpoint introduced in 8.15. Sometimes multi-cluster is executed against older versions on CI. This change ensures the test is executed only on versions with the endpoint.
1 parent dbd0e59 commit b270941

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ public void testIndexPattern() throws Exception {
400400

401401
@SuppressWarnings("unchecked")
402402
public void testStats() throws IOException {
403+
assumeTrue("capabilities endpoint is not available", capabilitiesEndpointAvailable());
404+
403405
Request caps = new Request("GET", "_capabilities?method=GET&path=_cluster/stats&capabilities=esql-stats");
404406
Response capsResponse = client().performRequest(caps);
405407
Map<String, Object> capsResult = entityAsMap(capsResponse.getEntity());
@@ -439,6 +441,10 @@ private static boolean ccsMetadataAvailable() {
439441
return Clusters.localClusterVersion().onOrAfter(Version.V_8_16_0);
440442
}
441443

444+
private static boolean capabilitiesEndpointAvailable() {
445+
return Clusters.localClusterVersion().onOrAfter(Version.V_8_15_0);
446+
}
447+
442448
private static boolean includeCCSMetadata() {
443449
return ccsMetadataAvailable() && randomBoolean();
444450
}

0 commit comments

Comments
 (0)