Skip to content

Commit ae90da4

Browse files
pabloemjbaiera
authored andcommitted
unmute test as it should be fixed (elastic#134092)
* unmute test as it should be fixed * fixup and comments * fixup
1 parent c9bfe25 commit ae90da4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,6 @@ tests:
495495
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
496496
method: test
497497
issue: https://github.com/elastic/elasticsearch/issues/133077
498-
- class: org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT
499-
method: testGroupBySubset
500-
issue: https://github.com/elastic/elasticsearch/issues/133220
501498
- class: org.elasticsearch.xpack.kql.parser.KqlParserBooleanQueryTests
502499
method: testParseOrQuery
503500
issue: https://github.com/elastic/elasticsearch/issues/133863
@@ -513,9 +510,6 @@ tests:
513510
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
514511
method: testWithCustomFeatureProcessors
515512
issue: https://github.com/elastic/elasticsearch/issues/134001
516-
- class: org.elasticsearch.xpack.esql.action.RandomizedTimeSeriesIT
517-
method: testRateGroupBySubset
518-
issue: https://github.com/elastic/elasticsearch/issues/134019
519513
- class: org.elasticsearch.cluster.ClusterInfoServiceIT
520514
method: testMaxQueueLatenciesInClusterInfo
521515
issue: https://github.com/elastic/elasticsearch/issues/134088

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/RandomizedTimeSeriesIT.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,16 @@ public void testGroupBySubset() {
550550
} else {
551551
assertThat(row.getFirst(), equalTo(docValues.isEmpty() ? null : docValues.getFirst().longValue()));
552552
}
553-
assertThat(row.get(1), equalTo(aggregatePerTimeseries(tsGroups, Agg.MAX, Agg.MAX)));
554-
assertThat(row.get(2), equalTo(aggregatePerTimeseries(tsGroups, Agg.MIN, Agg.MIN)));
555-
assertThat(row.get(3), equalTo(aggregatePerTimeseries(tsGroups, Agg.SUM, Agg.COUNT)));
556-
assertThat(row.get(4), equalTo(aggregatePerTimeseries(tsGroups, Agg.SUM, Agg.SUM)));
553+
Function<Object, Double> toDouble = cell -> switch (cell) {
554+
case Long l -> l.doubleValue();
555+
case Double d -> d;
556+
case null -> null;
557+
default -> throw new IllegalStateException("Unexpected value type: " + cell + " of class " + cell.getClass());
558+
};
559+
assertThat(toDouble.apply(row.get(1)), equalTo(aggregatePerTimeseries(tsGroups, Agg.MAX, Agg.MAX)));
560+
assertThat(toDouble.apply(row.get(2)), equalTo(aggregatePerTimeseries(tsGroups, Agg.MIN, Agg.MIN)));
561+
assertThat(toDouble.apply(row.get(3)), equalTo(aggregatePerTimeseries(tsGroups, Agg.SUM, Agg.COUNT)));
562+
assertThat(toDouble.apply(row.get(4)), equalTo(aggregatePerTimeseries(tsGroups, Agg.SUM, Agg.SUM)));
557563
var avg = (Double) aggregatePerTimeseries(tsGroups, Agg.AVG, Agg.AVG);
558564
assertThat((Double) row.get(5), row.get(5) == null ? equalTo(null) : closeTo(avg, avg * 0.01));
559565
// assertThat(row.get(6), equalTo(aggregatePerTimeseries(tsGroups, Agg.COUNT, Agg.COUNT).longValue()));

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/TSDataGenerationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private static Object randomDimensionValue(String dimensionName) {
5555
this.numDocs = numDocs;
5656
var maxAttributes = (int) Math.sqrt(numDocs);
5757
List<String> tempAttributeSet = List.copyOf(
58-
Set.copyOf(ESTestCase.randomList(1, maxAttributes, () -> ESTestCase.randomAlphaOfLengthBetween(2, 30)))
58+
Set.copyOf(ESTestCase.randomList(1, maxAttributes, () -> ESTestCase.randomAlphaOfLengthBetween(3, 30)))
5959
);
6060
var maxTimeSeries = (int) Math.sqrt(numDocs);
6161
var minTimeSeries = Math.max(1, maxTimeSeries / 4);

0 commit comments

Comments
 (0)