Skip to content

Commit

Permalink
Increase Test Timeout to 2 seconds for slow CI Servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
manticore-projects committed May 20, 2021
1 parent a51a204 commit 42abed4
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
*/
public class NestedBracketsPerformanceTest {

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue766() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat('1','2'),'3'),'4'),'5'),'6'),'7'),'8'),'9'),'10'),'11'),'12'),'13'),'14'),'15'),'16'),'17'),'18'),'19'),'20'),'21'),col1 FROM tbl t1", true);
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue766_2() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT concat(concat(concat('1', '2'), '3'), '4'), col1 FROM tbl t1");
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue235() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT CASE WHEN ( CASE WHEN ( CASE WHEN ( CASE WHEN ( 1 ) THEN 0 END ) THEN 0 END ) THEN 0 END ) THEN 0 END FROM a", true);
}

@Test(timeout = 100000)
@Test(timeout = 200000)
@Ignore
public void testIssue496() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("select isNull(charLen(TEST_ID,0)+ isNull(charLen(TEST_DVC,0)+ isNull(charLen(TEST_NO,0)+ isNull(charLen(ATEST_ID,0)+ isNull(charLen(TESTNO,0)+ isNull(charLen(TEST_CTNT,0)+ isNull(charLen(TEST_MESG_CTNT,0)+ isNull(charLen(TEST_DTM,0)+ isNull(charLen(TEST_DTT,0)+ isNull(charLen(TEST_ADTT,0)+ isNull(charLen(TEST_TCD,0)+ isNull(charLen(TEST_PD,0)+ isNull(charLen(TEST_VAL,0)+ isNull(charLen(TEST_YN,0)+ isNull(charLen(TEST_DTACM,0)+ isNull(charLen(TEST_MST,0) from test_info_m");
Expand All @@ -50,7 +50,7 @@ public void testIssue856() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(sql);
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testRecursiveBracketExpressionIssue1019() {
assertEquals("IF(1=1, 1, 2)", buildRecursiveBracketExpression("IF(1=1, $1, 2)", "1", 0));
assertEquals("IF(1=1, IF(1=1, 1, 2), 2)", buildRecursiveBracketExpression("IF(1=1, $1, 2)", "1", 1));
Expand All @@ -62,12 +62,12 @@ public void testRecursiveBracketExpressionIssue1019_2() throws JSQLParserExcepti
doIncreaseOfParseTimeTesting("IF(1=1, $1, 2)", "1", 10);
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue1013() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT ((((((((((((((((tblA)))))))))))))))) FROM mytable");
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue1013_2() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT * FROM ((((((((((((((((tblA))))))))))))))))");
}
Expand All @@ -77,7 +77,7 @@ public void testIssue1013_3() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed("SELECT * FROM (((tblA)))");
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue1013_4() throws JSQLParserException {
String s = "tblA";
for (int i = 1; i < 100; i++) {
Expand All @@ -95,13 +95,13 @@ public void testIssue1013_4() throws JSQLParserException {
*
* @throws JSQLParserException
*/
@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIncreaseOfParseTime() throws JSQLParserException {
doIncreaseOfParseTimeTesting("concat($1,'B')", "'A'", 50);
}

private void doIncreaseOfParseTimeTesting(String template, String finalExpression, int maxDepth) throws JSQLParserException {
long oldDurationTime = 1000;
long oldDurationTime = 2000;
int countProblematic = 0;
for (int i = 0; i < maxDepth; i++) {
String sql = "SELECT " + buildRecursiveBracketExpression(template, finalExpression, i) + " FROM mytbl";
Expand Down Expand Up @@ -137,7 +137,7 @@ private String buildRecursiveBracketExpression(String template, String finalExpr
return template.replace("$1", buildRecursiveBracketExpression(template, finalExpression, depth - 1));
}

@Test(timeout = 1000)
@Test(timeout = 2000)
public void testIssue1103() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(
"SELECT\n" + "ROUND(ROUND(ROUND(ROUND(ROUND(ROUND(ROUND(ROUND(\n"
Expand Down

0 comments on commit 42abed4

Please sign in to comment.