Skip to content
Snippets Groups Projects
Commit bce4089f authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Fix BlockManagerSuite to deal with clearing spark.hostPort

parent 68c07ea1
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ import org.scalatest.time.SpanSugar._ ...@@ -15,6 +15,8 @@ import org.scalatest.time.SpanSugar._
import spark.JavaSerializer import spark.JavaSerializer
import spark.KryoSerializer import spark.KryoSerializer
import spark.SizeEstimator import spark.SizeEstimator
import spark.Utils
import spark.util.AkkaUtils
import spark.util.ByteBufferInputStream import spark.util.ByteBufferInputStream
class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodTester { class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodTester {
...@@ -31,7 +33,12 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT ...@@ -31,7 +33,12 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
val serializer = new KryoSerializer val serializer = new KryoSerializer
before { 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( master = new BlockManagerMaster(
actorSystem.actorOf(Props(new spark.storage.BlockManagerMasterActor(true)))) actorSystem.actorOf(Props(new spark.storage.BlockManagerMasterActor(true))))
...@@ -44,6 +51,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT ...@@ -44,6 +51,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
} }
after { after {
System.clearProperty("spark.driver.port")
System.clearProperty("spark.hostPort")
if (store != null) { if (store != null) {
store.stop() store.stop()
store = null store = null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment