Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20516#discussion_r166348587
  
    --- Diff: 
core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala
 ---
    @@ -77,16 +79,68 @@ class NettyBlockTransferServiceSuite
         verifyServicePort(expectedPort = service0.port + 1, actualPort = 
service1.port)
       }
     
    +  test("can bind to max specific ports is true") {
    +    service0 = createService(port = 65535)
    +    verifyServicePort(expectedPort = 65535, actualPort = service0.port)
    +  }
    +
    +  test("can bind to two max specific ports") {
    +    service0 = createService(port = 65535)
    +    service1 = createService(port = 65535)
    +    verifyServicePort(expectedPort = 65535, actualPort = service0.port)
    +    // see `Utils.userPort` the user port to try when trying to bind a 
service,
    +    // the max privileged port is 1024.
    +    verifyServicePort(expectedPort = 1024, actualPort = service1.port)
    +  }
    +
    +  test("can't bind to a privileged port") {
    +    val excMsg = intercept[IllegalArgumentException] {
    +      service0 = createService(port = 23)
    +    }.getMessage
    +
    +    assert(excMsg.contains("startPort should be between 1024 and 65535 
(inclusive), " +
    --- End diff --
    
    It might be a little brittle to assert so much about the exact text of the 
message.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to