Skip to content

Commit 6e0bdbe

Browse files
Fixed flaky test after PR that disallows functions to return TEXT (#115633)
* Fixed flaky test after PR that disallows functions to return TEXT * Also ignore TEXT/KEYWORD combinations because they are now valid * Unmute the test
1 parent e3523c1 commit 6e0bdbe

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,6 @@ tests:
282282
- class: org.elasticsearch.oldrepos.OldRepositoryAccessIT
283283
method: testOldRepoAccess
284284
issue: https://github.com/elastic/elasticsearch/issues/115631
285-
- class: org.elasticsearch.xpack.esql.analysis.AnalyzerTests
286-
method: testMvAppendValidation
287-
issue: https://github.com/elastic/elasticsearch/issues/115636
288285

289286
# Examples:
290287
#

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import java.util.List;
5757
import java.util.Map;
5858
import java.util.Set;
59+
import java.util.function.Function;
5960
import java.util.function.Supplier;
6061
import java.util.stream.Collectors;
6162
import java.util.stream.IntStream;
@@ -1879,14 +1880,19 @@ public void testMvAppendValidation() {
18791880
Supplier<Integer> supplier = () -> randomInt(fields.length - 1);
18801881
int first = supplier.get();
18811882
int second = randomValueOtherThan(first, supplier);
1883+
Function<String, String> noText = (type) -> type.equals("text") ? "keyword" : type;
1884+
assumeTrue(
1885+
"Ignore tests with TEXT and KEYWORD combinations because they are now valid",
1886+
noText.apply(fields[first][0]).equals(noText.apply(fields[second][0])) == false
1887+
);
18821888

18831889
String signature = "mv_append(" + fields[first][0] + ", " + fields[second][0] + ")";
18841890
verifyUnsupported(
18851891
" from test | eval " + signature,
18861892
"second argument of ["
18871893
+ signature
18881894
+ "] must be ["
1889-
+ fields[first][1]
1895+
+ noText.apply(fields[first][1])
18901896
+ "], found value ["
18911897
+ fields[second][0]
18921898
+ "] type ["

0 commit comments

Comments
 (0)