Skip to content

Commit 7671c02

Browse files
authored
ESQL: Fix BasicBlockTests (#133743)
Closes #133596 Closes #133606 Closes #133608 Closes #133618 Closes #133621
1 parent a1f494a commit 7671c02

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

muted-tests.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -495,24 +495,9 @@ tests:
495495
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
496496
method: testStopQueryLocal
497497
issue: https://github.com/elastic/elasticsearch/issues/133481
498-
- class: org.elasticsearch.compute.data.BasicBlockTests
499-
method: testIntBlock
500-
issue: https://github.com/elastic/elasticsearch/issues/133596
501-
- class: org.elasticsearch.compute.data.BasicBlockTests
502-
method: testDoubleBlock
503-
issue: https://github.com/elastic/elasticsearch/issues/133606
504-
- class: org.elasticsearch.compute.data.BasicBlockTests
505-
method: testBooleanBlock
506-
issue: https://github.com/elastic/elasticsearch/issues/133608
507-
- class: org.elasticsearch.compute.data.BasicBlockTests
508-
method: testLongBlock
509-
issue: https://github.com/elastic/elasticsearch/issues/133618
510498
- class: org.elasticsearch.xpack.esql.inference.rerank.RerankOperatorTests
511499
method: testSimpleCircuitBreaking
512500
issue: https://github.com/elastic/elasticsearch/issues/133619
513-
- class: org.elasticsearch.compute.data.BasicBlockTests
514-
method: testFloatBlock
515-
issue: https://github.com/elastic/elasticsearch/issues/133621
516501
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
517502
method: test
518503
issue: https://github.com/elastic/elasticsearch/issues/133077

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,10 +1784,13 @@ public static Block assertDeepCopy(Block block) {
17841784
try (Block deepCopy = block.deepCopy(into)) {
17851785
assertThat(deepCopy, equalTo(block));
17861786

1787-
assertThat(
1788-
deepCopy.asVector() != null && deepCopy.asVector().isConstant(),
1789-
equalTo(block.asVector() != null && block.asVector().isConstant())
1790-
);
1787+
if (block.asVector() != null && block.asVector().isConstant()) {
1788+
/*
1789+
* If we were a constant, we will still be one. If we were not a constant,
1790+
* deepCopy might make a constant in the rare case that we have a single element array.
1791+
*/
1792+
assertThat(deepCopy.asVector() != null && deepCopy.asVector().isConstant(), equalTo(true));
1793+
}
17911794
}
17921795
Block untracked = block.deepCopy(TestBlockFactory.getNonBreakingInstance());
17931796
assertThat(untracked, equalTo(block));

0 commit comments

Comments
 (0)