aboutsummaryrefslogtreecommitdiff
path: root/repl
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-06-08 14:21:41 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-06-08 14:21:41 -0700
commit96c895f65347f7a0d793d6093ecc32aa1a1e26b7 (patch)
treec5c9d927c5492085b5a05dce8363755d46cf9af4 /repl
parent5b5b5aedbf01c84e49da884f361c1ca87f410628 (diff)
downloadspark-96c895f65347f7a0d793d6093ecc32aa1a1e26b7.tar.gz
spark-96c895f65347f7a0d793d6093ecc32aa1a1e26b7.tar.bz2
spark-96c895f65347f7a0d793d6093ecc32aa1a1e26b7.zip
Fix StandaloneClusterReplSuite to allow running multiple tests
Diffstat (limited to 'repl')
-rw-r--r--repl/src/test/scala/spark/repl/ReplSuiteMixin.scala17
-rw-r--r--repl/src/test/scala/spark/repl/StandaloneClusterReplSuite.scala4
2 files changed, 5 insertions, 16 deletions
diff --git a/repl/src/test/scala/spark/repl/ReplSuiteMixin.scala b/repl/src/test/scala/spark/repl/ReplSuiteMixin.scala
index 8f439f0681..3b5b6385ad 100644
--- a/repl/src/test/scala/spark/repl/ReplSuiteMixin.scala
+++ b/repl/src/test/scala/spark/repl/ReplSuiteMixin.scala
@@ -14,16 +14,6 @@ import spark.deploy.master.Master
import spark.deploy.worker.Worker
trait ReplSuiteMixin {
- val localIp = "127.0.1.2"
- val port = "7089"
- val sparkUrl = s"spark://$localIp:$port"
-
- def setupStandaloneCluster() {
- future { Master.main(Array("-i", localIp, "-p", port, "--webui-port", "0")) }
- Thread.sleep(2000)
- future { Worker.main(Array(sparkUrl, "--webui-port", "0")) }
- }
-
def runInterpreter(master: String, input: String): String = {
val in = new BufferedReader(new StringReader(input + "\n"))
val out = new StringWriter()
@@ -42,10 +32,11 @@ trait ReplSuiteMixin {
spark.repl.Main.interp = interp
val separator = System.getProperty("path.separator")
interp.process(Array("-classpath", paths.mkString(separator)))
- if (interp != null)
- interp.closeInterpreter();
+ if (interp != null) {
+ interp.closeInterpreter()
+ }
// To avoid Akka rebinding to the same port, since it doesn't unbind immediately on shutdown
- System.clearProperty("spark.master.port")
+ System.clearProperty("spark.driver.port")
return out.toString
}
diff --git a/repl/src/test/scala/spark/repl/StandaloneClusterReplSuite.scala b/repl/src/test/scala/spark/repl/StandaloneClusterReplSuite.scala
index 0822770fe2..0212d21fb8 100644
--- a/repl/src/test/scala/spark/repl/StandaloneClusterReplSuite.scala
+++ b/repl/src/test/scala/spark/repl/StandaloneClusterReplSuite.scala
@@ -7,7 +7,7 @@ import org.scalatest.FunSuite
import com.google.common.io.Files
class StandaloneClusterReplSuite extends FunSuite with ReplSuiteMixin {
- setupStandaloneCluster
+ val sparkUrl = "local-cluster[1,1,512]"
test("simple collect") {
val output = runInterpreter(sparkUrl, """
@@ -98,6 +98,4 @@ class StandaloneClusterReplSuite extends FunSuite with ReplSuiteMixin {
assertContains("res0: Array[Int] = Array(0, 0, 0, 0, 0)", output)
assertContains("res2: Array[Int] = Array(5, 0, 0, 0, 0)", output)
}
-
-
}