Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/20516#discussion_r166349531
--- 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), " +
+ "or 0 for a random free port."))
+ }
+
+ test("can't to bind same port") {
+ val port = 17634 + Random.nextInt(10000)
+ logInfo("random port for test: " + port)
+ service0 = createService(port)
+ verifyServicePort(expectedPort = port, actualPort = service0.port)
--- End diff --
I don't believe this part tests anything new?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]