Skip to content

Commit

Permalink
Sets SPARK_HOME as SPARK_PID_DIR when running Thrift server test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Feb 25, 2015
1 parent f816e73 commit 1b3d1e3
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,14 @@ abstract class HiveThriftServer2Test extends FunSuite with BeforeAndAfterAll wit

logInfo(s"Trying to start HiveThriftServer2: port=$port, mode=$mode, attempt=$attempt")

logPath = Process(command, None, "SPARK_TESTING" -> "0").lines.collectFirst {
val env = Seq(
// Disables SPARK_TESTING to exclude log4j.properties in test directories.
"SPARK_TESTING" -> "0",
// Points SPARK_PID_DIR to SPARK_HOME, otherwise only 1 Thrift server instance can be started
// at a time, which is not Jenkins friendly.
"SPARK_PID_DIR" -> "../../")

logPath = Process(command, None, env: _*).lines.collectFirst {
case line if line.contains(LOG_FILE_MARK) => new File(line.drop(LOG_FILE_MARK.length))
}.getOrElse {
throw new RuntimeException("Failed to find HiveThriftServer2 log file.")
Expand Down Expand Up @@ -346,7 +353,7 @@ abstract class HiveThriftServer2Test extends FunSuite with BeforeAndAfterAll wit

private def stopThriftServer(): Unit = {
// The `spark-daemon.sh' script uses kill, which is not synchronous, have to wait for a while.
Process(stopScript, None).run().exitValue()
Process(stopScript, None, "SPARK_PID_DIR" -> "../../").run().exitValue()
Thread.sleep(3.seconds.toMillis)

warehousePath.delete()
Expand Down

0 comments on commit 1b3d1e3

Please sign in to comment.