Skip to content

Commit

Permalink
Relaxes timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Oct 6, 2014
1 parent 5094bb4 commit 962f5f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class CliSuite extends FunSuite with BeforeAndAfterAll with Logging {

def captureOutput(source: String)(line: String) {
buffer += s"$source> $line"
if (line.contains(expectedAnswers(next.get()))) {
if (next.incrementAndGet() == expectedAnswers.size) {
foundAllExpectedAnswers.trySuccess(())
}
if (next.get() < expectedAnswers.size &&
line.startsWith(expectedAnswers(next.get())) &&
next.incrementAndGet() == expectedAnswers.size) {
foundAllExpectedAnswers.success(())
}
}

Expand Down Expand Up @@ -109,7 +109,7 @@ class CliSuite extends FunSuite with BeforeAndAfterAll with Logging {
val dataFilePath =
Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt")

runCliWithin(1.minute)(
runCliWithin(3.minute)(
"CREATE TABLE hive_test(key INT, val STRING);"
-> "OK",
"SHOW TABLES;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HiveThriftServer2Suite extends FunSuite with Logging {

val verbose = Option(System.getenv("SPARK_SQL_TEST_VERBOSE")).isDefined

def startThriftServerWithin(timeout: FiniteDuration = 10.seconds)(f: Statement => Unit) {
def startThriftServerWithin(timeout: FiniteDuration = 1.minute)(f: Statement => Unit) {
Thread.sleep(5000)

val startScript = "../../sbin/start-thriftserver.sh".split("/").mkString(File.separator)
Expand Down Expand Up @@ -79,15 +79,13 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
var logFilePath: String = null

def captureLogOutput(line: String): Unit = {
logInfo(s"server log | $line")
buffer += line
if (line.contains("ThriftBinaryCLIService listening on")) {
serverRunning.success(())
}
}

def captureThriftServerOutput(source: String)(line: String): Unit = {
logInfo(s"server $source | $line")
if (line.startsWith(LOGGING_MARK)) {
logFilePath = line.drop(LOGGING_MARK.length).trim
// Ensure that the log file is created so that the `tail' command won't fail
Expand Down

0 comments on commit 962f5f8

Please sign in to comment.