Skip to content

Commit

Permalink
[SPARK-8451] [SPARK-7287] SparkSubmitSuite should check exit code
Browse files Browse the repository at this point in the history
This patch also reenables the tests. Now that we have access to the log4j logs it should be easier to debug the flakiness.

yhuai brkyvz

Author: Andrew Or <[email protected]>

Closes #6886 from andrewor14/spark-submit-suite-fix and squashes the following commits:

3f99ff1 [Andrew Or] Move destroy to finally block
9a62188 [Andrew Or] Re-enable ignored tests
2382672 [Andrew Or] Check for exit code

(cherry picked from commit 68a2dca)
Signed-off-by: Andrew Or <[email protected]>
  • Loading branch information
Andrew Or committed Jun 19, 2015
1 parent 6f2e411 commit aedd893
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class SparkSubmitSuite
runSparkSubmit(args)
}

ignore("includes jars passed in through --jars") {
test("includes jars passed in through --jars") {
val unusedJar = TestUtils.createJarWithClasses(Seq.empty)
val jar1 = TestUtils.createJarWithClasses(Seq("SparkSubmitClassA"))
val jar2 = TestUtils.createJarWithClasses(Seq("SparkSubmitClassB"))
Expand All @@ -340,7 +340,7 @@ class SparkSubmitSuite
}

// SPARK-7287
ignore("includes jars passed in through --packages") {
test("includes jars passed in through --packages") {
val unusedJar = TestUtils.createJarWithClasses(Seq.empty)
val main = MavenCoordinate("my.great.lib", "mylib", "0.1")
val dep = MavenCoordinate("my.great.dep", "mylib", "0.1")
Expand Down Expand Up @@ -499,9 +499,16 @@ class SparkSubmitSuite
Seq("./bin/spark-submit") ++ args,
new File(sparkHome),
Map("SPARK_TESTING" -> "1", "SPARK_HOME" -> sparkHome))
failAfter(60 seconds) { process.waitFor() }
// Ensure we still kill the process in case it timed out
process.destroy()

try {
val exitCode = failAfter(60 seconds) { process.waitFor() }
if (exitCode != 0) {
fail(s"Process returned with exit code $exitCode. See the log4j logs for more detail.")
}
} finally {
// Ensure we still kill the process in case it timed out
process.destroy()
}
}

private def forConfDir(defaults: Map[String, String]) (f: String => Unit) = {
Expand Down

0 comments on commit aedd893

Please sign in to comment.