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:49 -0800 |
commit | fbcb949c545a1e17411403b23bb6bc20881fb26a (patch) | |
tree | 55fa05cb5d60446070465d3d33d947a26d32b454 | |
parent | 092b45f6939c88b41fbeb957d4d703bf8f008e48 (diff) | |
download | spark-fbcb949c545a1e17411403b23bb6bc20881fb26a.tar.gz spark-fbcb949c545a1e17411403b23bb6bc20881fb26a.tar.bz2 spark-fbcb949c545a1e17411403b23bb6bc20881fb26a.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
(cherry picked from commit fb87f449219c673a16bc46f85c1ef7a6e3f22736)
Signed-off-by: Andrew Or <andrew@databricks.com>
-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() |