Skip to content

Commit f09a985

Browse files
committed
Fix the flaky tests I just introduced
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
1 parent 949f2d0 commit f09a985

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ppl/src/test/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParserTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import java.util.List;
1313
import org.antlr.v4.runtime.tree.ParseTree;
14+
import org.hamcrest.text.StringContainsInOrder;
1415
import org.junit.Rule;
1516
import org.junit.Test;
1617
import org.junit.rules.ExpectedException;
@@ -340,6 +341,10 @@ public void testDescribeCommandWithSourceShouldFail() {
340341
exceptionRule.expectMessage(
341342
"[=] is not a valid term at this part of the query: 'describe source=' <-- HERE. Expecting"
342343
+ " tokens: EOF, '|', ',', '.'");
344+
exceptionRule.expectMessage(
345+
StringContainsInOrder.stringContainsInOrder(
346+
"[=] is not a valid term at this part of the query: 'describe source=' <-- HERE.",
347+
"Expecting tokens:"));
343348

344349
new PPLSyntaxParser().parse("describe source=t");
345350
}
@@ -348,9 +353,12 @@ public void testDescribeCommandWithSourceShouldFail() {
348353
public void testInvalidOperatorCombinationShouldFail() {
349354
exceptionRule.expect(RuntimeException.class);
350355
exceptionRule.expectMessage(
351-
"[<EOF>] is not a valid term at this part of the query: '...= t | where x > y OR' <-- HERE."
352-
+ " Expecting one of 294 possible tokens. Some examples: 'SEARCH', 'DESCRIBE', 'SHOW',"
353-
+ " 'FROM', 'WHERE', ...");
356+
StringContainsInOrder.stringContainsInOrder(
357+
"[<EOF>] is not a valid term at this part of the query: '...= t | where x > y OR' <--"
358+
+ " HERE.",
359+
"Expecting one of ",
360+
" possible tokens. Some examples: ",
361+
"..."));
354362

355363
new PPLSyntaxParser().parse("source = t | where x > y OR");
356364
}

0 commit comments

Comments
 (0)