Skip to content

Commit 0160c56

Browse files
authored
ESQL: Unmute and fix BlockMultiValuedTests.testToMask (#124339)
Fixes #124165
1 parent e81ac23 commit 0160c56

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
@@ -336,9 +336,6 @@ tests:
336336
- class: org.elasticsearch.search.query.QueryPhaseTimeoutTests
337337
method: testScorerTimeoutTerms
338338
issue: https://github.com/elastic/elasticsearch/issues/124141
339-
- class: org.elasticsearch.compute.data.BlockMultiValuedTests
340-
method: testToMask {elementType=BOOLEAN nullAllowed=true}
341-
issue: https://github.com/elastic/elasticsearch/issues/124165
342339
- class: org.elasticsearch.smoketest.MlWithSecurityIT
343340
method: test {yaml=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable is missing}
344341
issue: https://github.com/elastic/elasticsearch/issues/124168

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BlockMultiValuedTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.ArrayList;
3030
import java.util.Arrays;
3131
import java.util.List;
32+
import java.util.Objects;
3233
import java.util.function.IntUnaryOperator;
3334
import java.util.stream.IntStream;
3435

@@ -133,10 +134,12 @@ public void testToMask() {
133134
if (elementType != ElementType.BOOLEAN) {
134135
return;
135136
}
136-
int positionCount = randomIntBetween(1, 16 * 1024);
137+
int positionCount = randomIntBetween(0, 16 * 1024);
137138
var b = RandomBlock.randomBlock(blockFactory(), elementType, positionCount, nullAllowed, 2, 10, 0, 0);
138139
try (ToMask mask = ((BooleanBlock) b.block()).toMask()) {
139-
assertThat(mask.hadMultivaluedFields(), equalTo(true));
140+
var anyNonNullValue = b.values().stream().anyMatch(Objects::nonNull);
141+
assertThat(mask.hadMultivaluedFields(), equalTo(anyNonNullValue));
142+
140143
for (int p = 0; p < b.values().size(); p++) {
141144
List<Object> v = b.values().get(p);
142145
if (v == null) {

0 commit comments

Comments
 (0)