diff options
author | Jacek Lewandowski <lewandowski.jacek@gmail.com> | 2015-02-19 09:53:36 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-02-19 09:53:36 -0800 |
commit | fb87f449219c673a16bc46f85c1ef7a6e3f22736 (patch) | |
tree | 6a3969719aa180cc445afee4d794f51e73430fd0 /core | |
parent | e945aa6139e022d13ac793f46819cfee07b782fc (diff) | |
download | spark-fb87f449219c673a16bc46f85c1ef7a6e3f22736.tar.gz spark-fb87f449219c673a16bc46f85c1ef7a6e3f22736.tar.bz2 spark-fb87f449219c673a16bc46f85c1ef7a6e3f22736.zip |
SPARK-5548: Fix for AkkaUtilsSuite failure - attempt 2
Author: Jacek Lewandowski <lewandowski.jacek@gmail.com>
Closes #4653 from jacek-lewandowski/SPARK-5548-2-master and squashes the following commits:
0e199b6 [Jacek Lewandowski] SPARK-5548: applied reviewer's comments
843eafb [Jacek Lewandowski] SPARK-5548: Fix for AkkaUtilsSuite failure - attempt 2
Diffstat (limited to 'core')
-rw-r--r-- | core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala index 2cc5817758..6250d50fb7 100644 --- a/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala @@ -20,6 +20,7 @@ package org.apache.spark.util import java.util.concurrent.TimeoutException import scala.concurrent.Await +import scala.util.{Failure, Try} import akka.actor._ @@ -370,8 +371,12 @@ class AkkaUtilsSuite extends FunSuite with LocalSparkContext with ResetSystemPro val selection = slaveSystem.actorSelection( AkkaUtils.address(AkkaUtils.protocol(slaveSystem), "spark", "localhost", boundPort, "MapOutputTracker")) val timeout = AkkaUtils.lookupTimeout(conf) - intercept[TimeoutException] { - slaveTracker.trackerActor = Await.result(selection.resolveOne(timeout * 2), timeout) + val result = Try(Await.result(selection.resolveOne(timeout * 2), timeout)) + + result match { + case Failure(ex: ActorNotFound) => + case Failure(ex: TimeoutException) => + case r => fail(s"$r is neither Failure(ActorNotFound) nor Failure(TimeoutException)") } actorSystem.shutdown() |