Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pwendell committed Apr 28, 2014
1 parent b5be173 commit 96027c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ object SparkSubmit {
}
} else if (clusterManager == YARN) {
childMainClass = "org.apache.spark.deploy.yarn.Client"
// Special flag to avoid deprecation warnings at the client
sysProps("SPARK_SUBMIT") = "true"
childArgs += ("--jar", appArgs.primaryResource)
childArgs += ("--class", appArgs.mainClass)
}

// Special flag to avoid deprecation warnings at the client
sysProps("SPARK_SUBMIT") = "true"

val options = List[OptionAssigner](
new OptionAssigner(appArgs.master, ALL_CLUSTER_MGRS, false, sysProp = "spark.master"),
new OptionAssigner(appArgs.driverExtraClassPath, STANDALONE | YARN, true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
childArgsStr should include ("--num-executors 6")
mainClass should be ("org.apache.spark.deploy.yarn.Client")
classpath should have length (0)
sysProps should have size (0)
sysProps should have size (1)
}

test("handles YARN client mode") {
Expand All @@ -146,6 +146,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
sysProps("spark.yarn.dist.files") should be ("file1.txt,file2.txt")
sysProps("spark.yarn.dist.archives") should be ("archive1.txt,archive2.txt")
sysProps("spark.executor.instances") should be ("6")
sysProps("SPARK_SUBMIT") should be ("true")
}

test("handles standalone cluster mode") {
Expand All @@ -159,7 +160,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
childArgsStr should include ("launch spark://h:p thejar.jar org.SomeClass arg1 arg2")
mainClass should be ("org.apache.spark.deploy.Client")
classpath should have length (0)
sysProps should have size (1) // contains --jar entry
sysProps should have size (2) // contains --jar entry and SPARK_SUBMIT
}

test("handles standalone client mode") {
Expand Down

0 comments on commit 96027c7

Please sign in to comment.