Fix UISuite test to handle situations where DEFAULT_PORT is busy on the test machine
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/16caecec Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/16caecec Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/16caecec Branch: refs/heads/branch-0.8 Commit: 16caecec8cd8a8ef178bc32ef352e9ccd818c45b Parents: 22660f6 Author: Sundeep Narravula <sunde...@yahoo-inc.com> Authored: Thu Oct 3 22:31:11 2013 -0700 Committer: Sundeep Narravula <sunde...@yahoo-inc.com> Committed: Thu Oct 3 22:31:11 2013 -0700 ---------------------------------------------------------------------- core/src/test/scala/org/apache/spark/ui/UISuite.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/16caecec/core/src/test/scala/org/apache/spark/ui/UISuite.scala ---------------------------------------------------------------------- diff --git a/core/src/test/scala/org/apache/spark/ui/UISuite.scala b/core/src/test/scala/org/apache/spark/ui/UISuite.scala index 07c9f23..3b96040 100644 --- a/core/src/test/scala/org/apache/spark/ui/UISuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UISuite.scala @@ -26,7 +26,12 @@ class UISuite extends FunSuite { test("jetty port increases under contention") { val startPort = 4040 val server = new Server(startPort) - server.start() + + Try { server.start() } match { + case Success(s) => + case Failure(e) => + // Either case server port is busy hence setup for test complete + } val (jettyServer1, boundPort1) = JettyUtils.startJettyServer("localhost", startPort, Seq()) val (jettyServer2, boundPort2) = JettyUtils.startJettyServer("localhost", startPort, Seq())