Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,36 +558,12 @@ tests:
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
method: testUsesFileBasedRecoveryIfOperationsBasedRecoveryWouldBeUnreasonable
issue: https://github.com/elastic/elasticsearch/issues/135737
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IncreaseTests
method: testGroupingAggregate {TestCase=<small positive doubles>}
issue: https://github.com/elastic/elasticsearch/issues/135752
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IncreaseTests
method: testGroupingAggregate {TestCase=<positive ints>}
issue: https://github.com/elastic/elasticsearch/issues/135753
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IncreaseTests
method: testGroupingAggregate {TestCase=<positive longs>}
issue: https://github.com/elastic/elasticsearch/issues/135754
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IncreaseTests
method: testGroupingAggregate {TestCase=<big positive doubles>}
issue: https://github.com/elastic/elasticsearch/issues/135755
- class: org.elasticsearch.xpack.esql.ccq.AllSupportedFieldsIT
method: testFetchDenseVector {pref=null mode=time_series}
issue: https://github.com/elastic/elasticsearch/issues/135762
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IrateTests
method: testGroupingAggregate {TestCase=<positive longs>}
issue: https://github.com/elastic/elasticsearch/issues/135775
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/135787
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IrateTests
method: testGroupingAggregate {TestCase=<positive ints>}
issue: https://github.com/elastic/elasticsearch/issues/135814
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IrateTests
method: testGroupingAggregate {TestCase=<small positive doubles>}
issue: https://github.com/elastic/elasticsearch/issues/135757
- class: org.elasticsearch.xpack.esql.expression.function.aggregate.IrateTests
method: testGroupingAggregate {TestCase=<big positive doubles>}
issue: https://github.com/elastic/elasticsearch/issues/135756
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/135787
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Objects;
import java.util.function.Supplier;

import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;

Expand Down Expand Up @@ -127,17 +126,17 @@ private static TestCaseSupplier makeSupplier(TestCaseSupplier.TypedDataSupplier
matcher = Matchers.nullValue();
} else {
double increase = 0.0;
for (int i = 1; i < nonNullDataRows.size(); i++) {
double previous = ((Number) nonNullDataRows.get(i - 1)).doubleValue();
double current = ((Number) nonNullDataRows.get(i)).doubleValue();
for (int i = nonNullDataRows.size() - 1; i > 0; i--) {
double previous = ((Number) nonNullDataRows.get(i)).doubleValue();
double current = ((Number) nonNullDataRows.get(i - 1)).doubleValue();
if (current >= previous) {
increase += current - previous;
} else {
// Counter reset
increase += current;
}
}
matcher = closeTo(increase, 0.1 * increase);
matcher = Matchers.allOf(Matchers.greaterThanOrEqualTo(increase * 0.9), Matchers.lessThanOrEqualTo(increase * 1.5));
}

return new TestCaseSupplier.TestCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,22 @@ private static TestCaseSupplier makeSupplier(TestCaseSupplier.TypedDataSupplier
);

List<Object> nonNullDataRows = dataRows.stream().filter(Objects::nonNull).toList();
Object maxValue = null;
Object minValue = null;

for (int i = dataRows.size() - 1; i >= 0; i--) {
if (dataRows.get(i) != null) {
if (maxValue == null) {
maxValue = dataRows.get(i);
} else if (((Comparable) dataRows.get(i)).compareTo(maxValue) > 0) {
maxValue = dataRows.get(i);
}
if (minValue == null) {
minValue = dataRows.get(i);
} else if (((Comparable) dataRows.get(i)).compareTo(minValue) < 0) {
minValue = dataRows.get(i);
}
}
}

final Matcher<?> matcher;
Matcher<?> matcher;
if (nonNullDataRows.size() < 2) {
matcher = Matchers.nullValue();
} else {
var maxDiff = ((Number) maxValue).doubleValue() - ((Number) minValue).doubleValue();
matcher = Matchers.allOf(Matchers.greaterThanOrEqualTo(-maxDiff), Matchers.lessThanOrEqualTo(maxDiff));
var lastValue = ((Number) nonNullDataRows.getFirst()).doubleValue();
var secondLastValue = ((Number) nonNullDataRows.get(1)).doubleValue();
var increase = lastValue >= secondLastValue ? lastValue - secondLastValue : lastValue;
var largestTimestamp = timestamps.get(0);
var secondLargestTimestamp = timestamps.get(1);
var smallestTimestamp = timestamps.getLast();
matcher = Matchers.allOf(
Matchers.greaterThanOrEqualTo(increase / (largestTimestamp - smallestTimestamp) * 1000 * 0.9),
Matchers.lessThanOrEqualTo(
increase / (largestTimestamp - secondLargestTimestamp) * (largestTimestamp - smallestTimestamp) * 1000
)
);
}

return new TestCaseSupplier.TestCase(
Expand Down