Skip to content
Snippets Groups Projects
Commit 9d36ec24 authored by Cheng Lian's avatar Cheng Lian Committed by Yin Huai
Browse files

[SPARK-8567] [SQL] Debugging flaky HiveSparkSubmitSuite

Using similar approach used in `HiveThriftServer2Suite` to print stdout/stderr of the spawned process instead of logging them to see what happens on Jenkins. (This test suite only fails on Jenkins and doesn't spill out any log...)

cc yhuai

Author: Cheng Lian <lian@databricks.com>

Closes #6978 from liancheng/debug-hive-spark-submit-suite and squashes the following commits:

b031647 [Cheng Lian] Prints process stdout/stderr instead of logging them
parent cc465fd9
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@ package org.apache.spark.sql.hive
import java.io.File
import scala.sys.process.{ProcessLogger, Process}
import org.apache.spark._
import org.apache.spark.sql.hive.test.{TestHive, TestHiveContext}
import org.apache.spark.util.{ResetSystemProperties, Utils}
......@@ -82,12 +84,18 @@ class HiveSparkSubmitSuite
// This is copied from org.apache.spark.deploy.SparkSubmitSuite
private def runSparkSubmit(args: Seq[String]): Unit = {
val sparkHome = sys.props.getOrElse("spark.test.home", fail("spark.test.home is not set!"))
val process = Utils.executeCommand(
val process = Process(
Seq("./bin/spark-submit") ++ args,
new File(sparkHome),
Map("SPARK_TESTING" -> "1", "SPARK_HOME" -> sparkHome))
"SPARK_TESTING" -> "1",
"SPARK_HOME" -> sparkHome
).run(ProcessLogger(
(line: String) => { println(s"out> $line") },
(line: String) => { println(s"err> $line") }
))
try {
val exitCode = failAfter(120 seconds) { process.waitFor() }
val exitCode = failAfter(120 seconds) { process.exitValue() }
if (exitCode != 0) {
fail(s"Process returned with exit code $exitCode. See the log4j logs for more detail.")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment