File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ class CliSuite extends FunSuite with BeforeAndAfterAll with Logging {
6262
6363 def captureOutput (source : String )(line : String ) {
6464 buffer += s " $source> $line"
65- if (line.contains(expectedAnswers( next.get()))) {
66- if ( next.incrementAndGet() == expectedAnswers.size) {
67- foundAllExpectedAnswers.trySuccess(())
68- }
65+ if (next.get() < expectedAnswers.size &&
66+ line.startsWith(expectedAnswers( next.get())) &&
67+ next.incrementAndGet() == expectedAnswers.size) {
68+ foundAllExpectedAnswers.success(())
6969 }
7070 }
7171
@@ -109,7 +109,7 @@ class CliSuite extends FunSuite with BeforeAndAfterAll with Logging {
109109 val dataFilePath =
110110 Thread .currentThread().getContextClassLoader.getResource(" data/files/small_kv.txt" )
111111
112- runCliWithin(1 .minute)(
112+ runCliWithin(3 .minute)(
113113 " CREATE TABLE hive_test(key INT, val STRING);"
114114 -> " OK" ,
115115 " SHOW TABLES;"
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
4343
4444 val verbose = Option (System .getenv(" SPARK_SQL_TEST_VERBOSE" )).isDefined
4545
46- def startThriftServerWithin (timeout : FiniteDuration = 10 .seconds )(f : Statement => Unit ) {
46+ def startThriftServerWithin (timeout : FiniteDuration = 1 .minute )(f : Statement => Unit ) {
4747 Thread .sleep(5000 )
4848
4949 val startScript = " ../../sbin/start-thriftserver.sh" .split(" /" ).mkString(File .separator)
@@ -79,15 +79,13 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
7979 var logFilePath : String = null
8080
8181 def captureLogOutput (line : String ): Unit = {
82- logInfo(s " server log | $line" )
8382 buffer += line
8483 if (line.contains(" ThriftBinaryCLIService listening on" )) {
8584 serverRunning.success(())
8685 }
8786 }
8887
8988 def captureThriftServerOutput (source : String )(line : String ): Unit = {
90- logInfo(s " server $source | $line" )
9189 if (line.startsWith(LOGGING_MARK )) {
9290 logFilePath = line.drop(LOGGING_MARK .length).trim
9391 // Ensure that the log file is created so that the `tail' command won't fail
You can’t perform that action at this time.
0 commit comments