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

    https://github.com/apache/spark/pull/4337#discussion_r24297467
  
    --- 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 --
    
    It will actually fail if the very large random port, plus offset - 1024, 
rolls over to a negative value. The returned port will be negative. Although 
it's a rare case, I think writing the correct version is also clearer.


---
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