Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/20516#discussion_r166767609
--- Diff:
core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala
---
@@ -77,16 +79,53 @@ class NettyBlockTransferServiceSuite
verifyServicePort(expectedPort = service0.port + 1, actualPort =
service1.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") {
+ intercept[IllegalArgumentException] {
+ service0 = createService(port = 23)
+ }
+ }
+
+ test("turn off spark.port.maxRetries, bind repeat port is fail") {
+ val port = 17634 + Random.nextInt(10000)
--- End diff --
This seems to duplicate setup from other tests. Is it not possible to test
several conditions in one test passage?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]