diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-04-28 22:23:48 -0700 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-04-28 22:23:48 -0700 |
commit | bce4089f22f5e17811f63368b164fae66774095f (patch) | |
tree | 547518d430a9bc1f86b96038fe053911ceada018 | |
parent | 68c07ea198df8649ac41b2bf527edbf4d5dda88d (diff) | |
download | spark-bce4089f22f5e17811f63368b164fae66774095f.tar.gz spark-bce4089f22f5e17811f63368b164fae66774095f.tar.bz2 spark-bce4089f22f5e17811f63368b164fae66774095f.zip |
Fix BlockManagerSuite to deal with clearing spark.hostPort
-rw-r--r-- | core/src/test/scala/spark/storage/BlockManagerSuite.scala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/src/test/scala/spark/storage/BlockManagerSuite.scala b/core/src/test/scala/spark/storage/BlockManagerSuite.scala index b8c0f6fb76..77f444bcad 100644 --- a/core/src/test/scala/spark/storage/BlockManagerSuite.scala +++ b/core/src/test/scala/spark/storage/BlockManagerSuite.scala @@ -15,6 +15,8 @@ import org.scalatest.time.SpanSugar._ import spark.JavaSerializer import spark.KryoSerializer import spark.SizeEstimator +import spark.Utils +import spark.util.AkkaUtils import spark.util.ByteBufferInputStream class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodTester { @@ -31,7 +33,12 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT val serializer = new KryoSerializer before { - actorSystem = ActorSystem("test") + val hostname = Utils.localHostName + val (actorSystem, boundPort) = AkkaUtils.createActorSystem("test", hostname, 0) + this.actorSystem = actorSystem + System.setProperty("spark.driver.port", boundPort.toString) + System.setProperty("spark.hostPort", hostname + ":" + boundPort) + master = new BlockManagerMaster( actorSystem.actorOf(Props(new spark.storage.BlockManagerMasterActor(true)))) @@ -44,6 +51,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT } after { + System.clearProperty("spark.driver.port") + System.clearProperty("spark.hostPort") + if (store != null) { store.stop() store = null |