Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/2671#discussion_r18459283 --- Diff: sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala --- @@ -123,14 +128,45 @@ class HiveThriftServer2Suite extends FunSuite with Logging { |========================================= """.stripMargin, cause) } finally { - warehousePath.delete() - metastorePath.delete() process.destroy() } } + override def afterAll() { + warehousePath.delete() + metastorePath.delete() + stopThriftserver + } + + def stopThriftserver: Unit = { + val stopScript = "../../sbin/stop-thriftserver.sh".split("/").mkString(File.separator) + val builder = new ProcessBuilder(stopScript) + val process = builder.start() + new Thread("read stderr") { + override def run() { + for (line <- Source.fromInputStream(process.getErrorStream).getLines()) { + System.err.println(line) + } + } + }.start() + val output = new StringBuffer + val stdoutThread = new Thread("read stdout") { + override def run() { + for (line <- Source.fromInputStream(process.getInputStream).getLines()) { + output.append(line) --- End diff -- `output` is never used. Maybe you intended to print it?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org