Skip to content

Commit

Permalink
Fix MultiClustersIT#testStats (elastic#119494)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
idegtiarenko authored Jan 6, 2025
1 parent 0dbe034 commit 23e7fe9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ public void testIndexPattern() throws Exception {

@SuppressWarnings("unchecked")
public void testStats() throws IOException {
assumeTrue("capabilities endpoint is not available", capabilitiesEndpointAvailable());

Request caps = new Request("GET", "_capabilities?method=GET&path=_cluster/stats&capabilities=esql-stats");
Response capsResponse = client().performRequest(caps);
Map<String, Object> capsResult = entityAsMap(capsResponse.getEntity());
Expand Down Expand Up @@ -439,6 +441,10 @@ private static boolean ccsMetadataAvailable() {
return Clusters.localClusterVersion().onOrAfter(Version.V_8_16_0);
}

private static boolean capabilitiesEndpointAvailable() {
return Clusters.localClusterVersion().onOrAfter(Version.V_8_15_0);
}

private static boolean includeCCSMetadata() {
return ccsMetadataAvailable() && randomBoolean();
}
Expand Down

0 comments on commit 23e7fe9

Please sign in to comment.