diff options
author | CodingCat <zhunansjtu@gmail.com> | 2014-01-15 20:46:14 -0500 |
---|---|---|
committer | CodingCat <zhunansjtu@gmail.com> | 2014-01-20 02:50:30 -0500 |
commit | 29f4b6a2d9f42a727691444312964e59ef9b95ee (patch) | |
tree | 325613a90c29937776d91708a2d649469c4025c0 /core/src/test | |
parent | f9a95d67365509cdd260858e858e7a9b120c1d1b (diff) | |
download | spark-29f4b6a2d9f42a727691444312964e59ef9b95ee.tar.gz spark-29f4b6a2d9f42a727691444312964e59ef9b95ee.tar.bz2 spark-29f4b6a2d9f42a727691444312964e59ef9b95ee.zip |
fix for SPARK-1027
change TestClient & Worker to Some("xxx")
kill manager if it is started
remove unnecessary .get when fetch "SPARK_HOME" values
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala | 2 | ||||
-rw-r--r-- | core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala b/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala index d05bbd6ff7..693b1ab237 100644 --- a/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala @@ -74,7 +74,7 @@ class JsonProtocolSuite extends FunSuite { def createAppDesc(): ApplicationDescription = { val cmd = new Command("mainClass", List("arg1", "arg2"), Map()) - new ApplicationDescription("name", Some(4), 1234, cmd, "sparkHome", "appUiUrl") + new ApplicationDescription("name", Some(4), 1234, cmd, Some("sparkHome"), "appUiUrl") } def createAppInfo() : ApplicationInfo = { diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala b/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala index a79ee690d3..4baa65659f 100644 --- a/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala +++ b/core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala @@ -26,11 +26,11 @@ import org.apache.spark.deploy.{ExecutorState, Command, ApplicationDescription} class ExecutorRunnerTest extends FunSuite { test("command includes appId") { def f(s:String) = new File(s) - val sparkHome = sys.env.get("SPARK_HOME").orElse(sys.props.get("spark.home")).get + val sparkHome = sys.env.get("SPARK_HOME").orElse(sys.props.get("spark.home")) val appDesc = new ApplicationDescription("app name", Some(8), 500, Command("foo", Seq(),Map()), sparkHome, "appUiUrl") val appId = "12345-worker321-9876" - val er = new ExecutorRunner(appId, 1, appDesc, 8, 500, null, "blah", "worker321", f(sparkHome), + val er = new ExecutorRunner(appId, 1, appDesc, 8, 500, null, "blah", "worker321", f(sparkHome.getOrElse(".")), f("ooga"), "blah", ExecutorState.RUNNING) assert(er.getCommandSeq.last === appId) |