Repository: spark
Updated Branches:
  refs/heads/master dba314029 -> f9f5fd5f4


Fix UISuite unit test that fails under Jenkins contention

Due to perhaps zombie processes on Jenkins, it seems that at least 10
Spark ports are in use. It also doesn't matter that the port increases
when used, it could in fact go down -- the only part that matters is
that it selects a different port rather than failing to bind.
Changed test to match this.

Thanks to @andrewor14 for helping diagnose this.

Author: Aaron Davidson <aa...@databricks.com>

Closes #857 from aarondav/tiny and squashes the following commits:

c199ec8 [Aaron Davidson] Fix UISuite unit test that fails under Jenkins 
contention


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f9f5fd5f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f9f5fd5f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f9f5fd5f

Branch: refs/heads/master
Commit: f9f5fd5f4e81828a3e0c391892e0f28751568843
Parents: dba3140
Author: Aaron Davidson <aa...@databricks.com>
Authored: Thu May 22 15:11:05 2014 -0700
Committer: Reynold Xin <r...@apache.org>
Committed: Thu May 22 15:11:05 2014 -0700

----------------------------------------------------------------------
 core/src/test/scala/org/apache/spark/ui/UISuite.scala | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/f9f5fd5f/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 fff8020..038746d 100644
--- a/core/src/test/scala/org/apache/spark/ui/UISuite.scala
+++ b/core/src/test/scala/org/apache/spark/ui/UISuite.scala
@@ -94,7 +94,7 @@ class UISuite extends FunSuite {
     }
   }
 
-  test("jetty port increases under contention") {
+  test("jetty selects different port under contention") {
     val startPort = 4040
     val server = new Server(startPort)
 
@@ -110,8 +110,9 @@ class UISuite extends FunSuite {
     // Allow some wiggle room in case ports on the machine are under contention
     val boundPort1 = serverInfo1.boundPort
     val boundPort2 = serverInfo2.boundPort
-    assert(boundPort1 > startPort && boundPort1 < startPort + 10)
-    assert(boundPort2 > boundPort1 && boundPort2 < boundPort1 + 10)
+    assert(boundPort1 != startPort)
+    assert(boundPort2 != startPort)
+    assert(boundPort1 != boundPort2)
   }
 
   test("jetty binds to port 0 correctly") {

Reply via email to