@@ -51,29 +51,17 @@ class AkkaUtilsSuite extends FunSuite with LocalSparkContext {
5151 System .setProperty(" SPARK_SECRET" , " bad" )
5252 val securityManagerBad = new SecurityManager ();
5353
54+ assert(securityManagerBad.isAuthenticationEnabled() === true )
55+
5456 val (slaveSystem, _) = AkkaUtils .createActorSystem(" spark-slave" , hostname, 0 ,
5557 conf = conf, securityManager = securityManagerBad)
5658 val slaveTracker = new MapOutputTracker (conf)
5759 val selection = slaveSystem.actorSelection(
5860 s " akka.tcp://spark@localhost: $boundPort/user/MapOutputTracker " )
5961 val timeout = AkkaUtils .lookupTimeout(conf)
60- slaveTracker.trackerActor = Await .result(selection.resolveOne(timeout), timeout)
61-
62- assert(securityManagerBad.isAuthenticationEnabled() === true )
63-
64- masterTracker.registerShuffle(10 , 1 )
65- masterTracker.incrementEpoch()
66- slaveTracker.updateEpoch(masterTracker.getEpoch)
67-
68- val compressedSize1000 = MapOutputTracker .compressSize(1000L )
69- val size1000 = MapOutputTracker .decompressSize(compressedSize1000)
70- masterTracker.registerMapOutput(10 , 0 , new MapStatus (
71- BlockManagerId (" a" , " hostA" , 1000 , 0 ), Array (compressedSize1000)))
72- masterTracker.incrementEpoch()
73- slaveTracker.updateEpoch(masterTracker.getEpoch)
74-
75- // this should fail since password wrong
76- intercept[SparkException ] { slaveTracker.getServerStatuses(10 , 0 ) }
62+ intercept[akka.actor.ActorNotFound ] {
63+ slaveTracker.trackerActor = Await .result(selection.resolveOne(timeout), timeout)
64+ }
7765
7866 actorSystem.shutdown()
7967 slaveSystem.shutdown()
@@ -198,30 +186,17 @@ class AkkaUtilsSuite extends FunSuite with LocalSparkContext {
198186 System .setProperty(" SPARK_SECRET" , " bad" )
199187 val securityManagerBad = new SecurityManager ();
200188
189+ assert(securityManagerBad.isAuthenticationEnabled() === false )
190+
201191 val (slaveSystem, _) = AkkaUtils .createActorSystem(" spark-slave" , hostname, 0 ,
202192 conf = conf, securityManager = securityManagerBad)
203193 val slaveTracker = new MapOutputTracker (conf)
204194 val selection = slaveSystem.actorSelection(
205195 s " akka.tcp://spark@localhost: $boundPort/user/MapOutputTracker " )
206196 val timeout = AkkaUtils .lookupTimeout(conf)
207- slaveTracker.trackerActor = Await .result(selection.resolveOne(timeout), timeout)
208-
209-
210- assert(securityManagerBad.isAuthenticationEnabled() === false )
211-
212- masterTracker.registerShuffle(10 , 1 )
213- masterTracker.incrementEpoch()
214- slaveTracker.updateEpoch(masterTracker.getEpoch)
215-
216- val compressedSize1000 = MapOutputTracker .compressSize(1000L )
217- val size1000 = MapOutputTracker .decompressSize(compressedSize1000)
218- masterTracker.registerMapOutput(10 , 0 , new MapStatus (
219- BlockManagerId (" a" , " hostA" , 1000 , 0 ), Array (compressedSize1000)))
220- masterTracker.incrementEpoch()
221- slaveTracker.updateEpoch(masterTracker.getEpoch)
222-
223- // this should fail since security on in server and off in client
224- intercept[SparkException ] { slaveTracker.getServerStatuses(10 , 0 ) }
197+ intercept[akka.actor.ActorNotFound ] {
198+ slaveTracker.trackerActor = Await .result(selection.resolveOne(timeout), timeout)
199+ }
225200
226201 actorSystem.shutdown()
227202 slaveSystem.shutdown()
0 commit comments