Skip to content

Commit

Permalink
Fixed flaky test after PR that disallows functions to return TEXT (el…
Browse files Browse the repository at this point in the history
…astic#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
  • Loading branch information
craigtaverner committed Oct 25, 2024
1 parent 3cc5796 commit 7d7cc77
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
Expand Down Expand Up @@ -1886,14 +1887,19 @@ public void testMvAppendValidation() {
Supplier<Integer> supplier = () -> randomInt(fields.length - 1);
int first = supplier.get();
int second = randomValueOtherThan(first, supplier);
Function<String, String> noText = (type) -> type.equals("text") ? "keyword" : type;
assumeTrue(
"Ignore tests with TEXT and KEYWORD combinations because they are now valid",
noText.apply(fields[first][0]).equals(noText.apply(fields[second][0])) == false
);

String signature = "mv_append(" + fields[first][0] + ", " + fields[second][0] + ")";
verifyUnsupported(
" from test | eval " + signature,
"second argument of ["
+ signature
+ "] must be ["
+ fields[first][1]
+ noText.apply(fields[first][1])
+ "], found value ["
+ fields[second][0]
+ "] type ["
Expand Down

0 comments on commit 7d7cc77

Please sign in to comment.