Skip to content

Commit 353bf94

Browse files
Fixed flaky test after PR that disallows functions to return TEXT (#115633) (#115651)
Backport of #115633
1 parent 6051760 commit 353bf94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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
@@ -63,6 +63,7 @@
6363
import java.util.List;
6464
import java.util.Map;
6565
import java.util.Set;
66+
import java.util.function.Function;
6667
import java.util.function.Supplier;
6768
import java.util.stream.Collectors;
6869
import java.util.stream.IntStream;
@@ -1886,14 +1887,19 @@ public void testMvAppendValidation() {
18861887
Supplier<Integer> supplier = () -> randomInt(fields.length - 1);
18871888
int first = supplier.get();
18881889
int second = randomValueOtherThan(first, supplier);
1890+
Function<String, String> noText = (type) -> type.equals("text") ? "keyword" : type;
1891+
assumeTrue(
1892+
"Ignore tests with TEXT and KEYWORD combinations because they are now valid",
1893+
noText.apply(fields[first][0]).equals(noText.apply(fields[second][0])) == false
1894+
);
18891895

18901896
String signature = "mv_append(" + fields[first][0] + ", " + fields[second][0] + ")";
18911897
verifyUnsupported(
18921898
" from test | eval " + signature,
18931899
"second argument of ["
18941900
+ signature
18951901
+ "] must be ["
1896-
+ fields[first][1]
1902+
+ noText.apply(fields[first][1])
18971903
+ "], found value ["
18981904
+ fields[second][0]
18991905
+ "] type ["

0 commit comments

Comments
 (0)