Skip to content

Commit fa42c0e

Browse files
committed
Fix TimeSeriesIT#testProfile
1 parent b3a06fb commit fa42c0e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,6 @@ tests:
648648
- class: org.elasticsearch.compute.data.BasicBlockTests
649649
method: testFloatBlock
650650
issue: https://github.com/elastic/elasticsearch/issues/133621
651-
- class: org.elasticsearch.xpack.esql.action.TimeSeriesIT
652-
method: testProfile
653-
issue: https://github.com/elastic/elasticsearch/issues/133624
654651

655652
# Examples:
656653
#

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import static org.elasticsearch.index.mapper.DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER;
3434
import static org.hamcrest.Matchers.closeTo;
3535
import static org.hamcrest.Matchers.containsString;
36+
import static org.hamcrest.Matchers.either;
3637
import static org.hamcrest.Matchers.empty;
3738
import static org.hamcrest.Matchers.equalTo;
3839
import static org.hamcrest.Matchers.hasSize;
@@ -553,7 +554,9 @@ public void testProfile() {
553554
if (p.operators().stream().anyMatch(s -> s.status() instanceof TimeSeriesSourceOperator.Status)) {
554555
assertThat(p.operators(), hasSize(2));
555556
TimeSeriesSourceOperator.Status status = (TimeSeriesSourceOperator.Status) p.operators().get(0).status();
556-
assertThat(status.processedShards(), hasSize(1));
557+
// If the target shard is empty or does not match the query, processedShards will be empty.
558+
// TODO: Update ComputeService to avoid creating pipelines for non-matching or empty shards.
559+
assertThat(status.processedShards(), either(hasSize(1)).or(empty()));
557560
assertThat(p.operators().get(1).operator(), equalTo("ExchangeSinkOperator"));
558561
} else if (p.operators().stream().anyMatch(s -> s.status() instanceof TimeSeriesAggregationOperator.Status)) {
559562
assertThat(p.operators(), hasSize(3));
@@ -587,7 +590,7 @@ public void testProfile() {
587590
assertThat(ops.get(0).operator(), containsString("LuceneSourceOperator"));
588591
assertThat(ops.get(0).status(), Matchers.instanceOf(LuceneSourceOperator.Status.class));
589592
LuceneSourceOperator.Status status = (LuceneSourceOperator.Status) ops.get(0).status();
590-
assertThat(status.processedShards(), hasSize(3));
593+
assertThat(status.processedShards().size(), Matchers.lessThanOrEqualTo(3));
591594
assertThat(ops.get(1).operator(), containsString("EvalOperator"));
592595
assertThat(ops.get(2).operator(), containsString("ValuesSourceReaderOperator"));
593596
assertThat(ops.get(3).operator(), containsString("TimeSeriesAggregationOperator"));

0 commit comments

Comments
 (0)