Repository: spark
Updated Branches:
  refs/heads/branch-1.0 79cd26c52 -> a56621622


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 <[email protected]>

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

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

(cherry picked from commit f9f5fd5f4e81828a3e0c391892e0f28751568843)
Signed-off-by: Reynold Xin <[email protected]>


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

Branch: refs/heads/branch-1.0
Commit: a56621622fdfe3aa691d13574d4831c0053a7059
Parents: 79cd26c
Author: Aaron Davidson <[email protected]>
Authored: Thu May 22 15:11:05 2014 -0700
Committer: Reynold Xin <[email protected]>
Committed: Thu May 22 15:11:12 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/a5662162/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