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

    https://github.com/apache/spark/pull/4337#discussion_r24295716
  
    --- Diff: 
external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumeStreamSuite.scala
 ---
    @@ -76,7 +75,7 @@ class FlumeStreamSuite extends FunSuite with 
BeforeAndAfter with Matchers with L
     
       /** Find a free port */
       private def findFreePort(): Int = {
    -    Utils.startServiceOnPort(23456, (trialPort: Int) => {
    +    Utils.startServiceOnPort((math.random * Int.MaxValue).toInt, 
(trialPort: Int) => {
    --- End diff --
    
    `Utils#startServiceOnPort` adjusts the range of port so I simply pass the 
random value to the method. But I noticed we should pass the value > 0.
    
          val tryPort = if (startPort == 0) {
            startPort
          } else {
            // If the new port wraps around, do not try a privilege port
            ((startPort + offset - 1024) % (65536 - 1024)) + 1024
          }
    
    So, I'll fix the it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to