Skip to content

Commit 962f5f8

Browse files
committed
Relaxes timeout
1 parent 5094bb4 commit 962f5f8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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;"

sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)