[ https://issues.apache.org/jira/browse/SPARK-34040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
feiwang updated SPARK-34040: ---------------------------- Description: Here is a test case(query contains '\n') which can not be covered by runCliWithin: {code:java} runCliWithin(1.minute)("select 'test1';\n select 'test2';" -> "test2") {code} {code:java} 11:35:00.383 pool-1-thread-1-ScalaTest-running-CliSuite INFO CliSuite: Cli driver is booted. Waiting for expected answers. 11:35:01.104 Thread-6 INFO CliSuite: 2021-01-06 19:35:01.104 - stdout> spark-sql> select 'test1'; 11:35:01.104 Thread-6 INFO CliSuite: stdout> found expected output line 0: 'spark-sql> select 'test1';' 11:35:10.120 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.12 - stdout> test1 11:35:10.121 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.121 - stderr> Time taken: 8.987 seconds, Fetched 1 row(s) 11:35:10.151 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.151 - stdout> spark-sql> select 'test2'; 11:35:10.220 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.22 - stdout> test2 11:35:10.220 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.22 - stderr> Time taken: 0.068 seconds, Fetched 1 row(s) 11:35:10.443 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.443 - stdout> spark-sql> 11:36:00.390 pool-1-thread-1-ScalaTest-running-CliSuite ERROR CliSuite: ======================= CliSuite failure output ======================= Spark SQL CLI command line: ../../bin/spark-sql --master local --driver-java-options -Dderby.system.durability=test --conf spark.ui.enabled=false --hiveconf javax.jdo.option.ConnectionURL=jdbc:derby:;databaseName=/Users/fwang12/ebay/apache-spark/target/tmp/spark-7c275c0c-fc8e-49c7-b643-18f20fe8ba51;create=true --hiveconf hive.exec.scratchdir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-bb0fded2-1a25-45d2-9f78-16898f32aefc --hiveconf conf1=conftest --hiveconf conf2=1 --hiveconf hive.metastore.warehouse.dir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-4901396f-9a7a-4299-b7fc-9cb3b24c46f4 Exception: java.util.concurrent.TimeoutException: Futures timed out after [1 minute] Failed to capture next expected output " > select 'test2';" within 1 minute. {code} It seems that it is not recommended to transfer multiple queries one time, but there is some UT like this: https://github.com/apache/spark/blob/f9daf035f473fea12a2ee67428db8d78f29973d5/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala#L542-L544 was: Here is a test case(query contains '\n') which can not be covered by runCliWithin: {code:java} runCliWithin(1.minute)("select 'test1';\n select 'test2';" -> "test2") {code} {code:java} 11:35:00.383 pool-1-thread-1-ScalaTest-running-CliSuite INFO CliSuite: Cli driver is booted. Waiting for expected answers. 11:35:01.104 Thread-6 INFO CliSuite: 2021-01-06 19:35:01.104 - stdout> spark-sql> select 'test1'; 11:35:01.104 Thread-6 INFO CliSuite: stdout> found expected output line 0: 'spark-sql> select 'test1';' 11:35:10.120 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.12 - stdout> test1 11:35:10.121 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.121 - stderr> Time taken: 8.987 seconds, Fetched 1 row(s) 11:35:10.151 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.151 - stdout> spark-sql> select 'test2'; 11:35:10.220 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.22 - stdout> test2 11:35:10.220 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.22 - stderr> Time taken: 0.068 seconds, Fetched 1 row(s) 11:35:10.443 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.443 - stdout> spark-sql> 11:36:00.390 pool-1-thread-1-ScalaTest-running-CliSuite ERROR CliSuite: ======================= CliSuite failure output ======================= Spark SQL CLI command line: ../../bin/spark-sql --master local --driver-java-options -Dderby.system.durability=test --conf spark.ui.enabled=false --hiveconf javax.jdo.option.ConnectionURL=jdbc:derby:;databaseName=/Users/fwang12/ebay/apache-spark/target/tmp/spark-7c275c0c-fc8e-49c7-b643-18f20fe8ba51;create=true --hiveconf hive.exec.scratchdir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-bb0fded2-1a25-45d2-9f78-16898f32aefc --hiveconf conf1=conftest --hiveconf conf2=1 --hiveconf hive.metastore.warehouse.dir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-4901396f-9a7a-4299-b7fc-9cb3b24c46f4 Exception: java.util.concurrent.TimeoutException: Futures timed out after [1 minute] Failed to capture next expected output " > select 'test2';" within 1 minute. {code} It seems that it is not better to transfer multiple queries one time, but there is some UT like this: https://github.com/apache/spark/blob/f9daf035f473fea12a2ee67428db8d78f29973d5/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala#L542-L544 > function runCliWithin of CliSuite can not cover some test cases > --------------------------------------------------------------- > > Key: SPARK-34040 > URL: https://issues.apache.org/jira/browse/SPARK-34040 > Project: Spark > Issue Type: Test > Components: SQL > Affects Versions: 3.0.1 > Reporter: feiwang > Priority: Minor > > Here is a test case(query contains '\n') which can not be covered by > runCliWithin: > {code:java} > runCliWithin(1.minute)("select 'test1';\n select 'test2';" -> "test2") > {code} > {code:java} > 11:35:00.383 pool-1-thread-1-ScalaTest-running-CliSuite INFO CliSuite: Cli > driver is booted. Waiting for expected answers. > 11:35:01.104 Thread-6 INFO CliSuite: 2021-01-06 19:35:01.104 - stdout> > spark-sql> select 'test1'; > 11:35:01.104 Thread-6 INFO CliSuite: stdout> found expected output line 0: > 'spark-sql> select 'test1';' > 11:35:10.120 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.12 - stdout> test1 > 11:35:10.121 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.121 - stderr> Time > taken: 8.987 seconds, Fetched 1 row(s) > 11:35:10.151 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.151 - stdout> > spark-sql> select 'test2'; > 11:35:10.220 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.22 - stdout> test2 > 11:35:10.220 Thread-7 INFO CliSuite: 2021-01-06 19:35:10.22 - stderr> Time > taken: 0.068 seconds, Fetched 1 row(s) > 11:35:10.443 Thread-6 INFO CliSuite: 2021-01-06 19:35:10.443 - stdout> > spark-sql> > 11:36:00.390 pool-1-thread-1-ScalaTest-running-CliSuite ERROR CliSuite: > ======================= > CliSuite failure output > ======================= > Spark SQL CLI command line: ../../bin/spark-sql --master local > --driver-java-options -Dderby.system.durability=test --conf > spark.ui.enabled=false --hiveconf > javax.jdo.option.ConnectionURL=jdbc:derby:;databaseName=/Users/fwang12/ebay/apache-spark/target/tmp/spark-7c275c0c-fc8e-49c7-b643-18f20fe8ba51;create=true > --hiveconf > hive.exec.scratchdir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-bb0fded2-1a25-45d2-9f78-16898f32aefc > --hiveconf conf1=conftest --hiveconf conf2=1 --hiveconf > hive.metastore.warehouse.dir=/Users/fwang12/ebay/apache-spark/target/tmp/spark-4901396f-9a7a-4299-b7fc-9cb3b24c46f4 > Exception: java.util.concurrent.TimeoutException: Futures timed out after [1 > minute] > Failed to capture next expected output " > select 'test2';" within 1 > minute. > {code} > It seems that it is not recommended to transfer multiple queries one time, > but there is some UT like this: > https://github.com/apache/spark/blob/f9daf035f473fea12a2ee67428db8d78f29973d5/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala#L542-L544 -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org