Skip to content

Commit 256a7fe

Browse files
authored
Skip downsample IT test with TS command when command not present (#131556)
Fixes #131500
1 parent 74cd006 commit 256a7fe

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,6 @@ tests:
475475
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
476476
method: testCancellationViaTimeoutWithAllowPartialResultsSetToFalse
477477
issue: https://github.com/elastic/elasticsearch/issues/131248
478-
- class: org.elasticsearch.xpack.downsample.DownsampleIT
479-
method: testAggMetricInEsqlTSAfterDownsampling
480-
issue: https://github.com/elastic/elasticsearch/issues/131500
481478
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
482479
method: test
483480
issue: https://github.com/elastic/elasticsearch/issues/131508

x-pack/plugin/downsample/src/internalClusterTest/java/org/elasticsearch/xpack/downsample/DownsampleIT.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
package org.elasticsearch.xpack.downsample;
99

10-
import org.elasticsearch.Build;
10+
import org.elasticsearch.action.admin.cluster.node.capabilities.NodesCapabilitiesRequest;
1111
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
1212
import org.elasticsearch.action.admin.indices.delete.TransportDeleteIndexAction;
1313
import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.cluster.metadata.DataStreamAction;
1919
import org.elasticsearch.cluster.metadata.IndexMetadata;
2020
import org.elasticsearch.common.settings.Settings;
21+
import org.elasticsearch.rest.RestRequest;
2122
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval;
2223
import org.elasticsearch.test.ClusterServiceUtils;
2324
import org.elasticsearch.xcontent.XContentBuilder;
@@ -35,6 +36,7 @@
3536

3637
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
3738
import static org.elasticsearch.xpack.downsample.DownsampleDataStreamTests.TIMEOUT;
39+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.METRICS_COMMAND;
3840
import static org.hamcrest.Matchers.equalTo;
3941
import static org.hamcrest.Matchers.hasSize;
4042

@@ -216,9 +218,11 @@ public void testAggMetricInEsqlTSAfterDownsampling() throws Exception {
216218
};
217219
bulkIndex(dataStreamName, nextSourceSupplier, 100);
218220

219-
if (Build.current().isSnapshot() == false) {
220-
return;
221-
}
221+
// check that TS command is available
222+
var response = clusterAdmin().nodesCapabilities(
223+
new NodesCapabilitiesRequest().method(RestRequest.Method.POST).path("/_query").capabilities(METRICS_COMMAND.capabilityName())
224+
).actionGet();
225+
assumeTrue("TS command must be available for this test", response.isSupported().orElse(Boolean.FALSE));
222226

223227
// Since the downsampled field (cpu) is downsampled in one index and not in the other, we want to confirm
224228
// first that the field is unsupported and has 2 original types - double and aggregate_metric_double

0 commit comments

Comments
 (0)