[ 
https://issues.apache.org/jira/browse/FLUME-2026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13682983#comment-13682983
 ] 

Mike Percy commented on FLUME-2026:
-----------------------------------

On this one, it would be better to use the pattern where you create a new 
server socket on port 0, query it to find the port assigned by the OS, then 
close the socket. Use that port in the test. The OS will not assign that port 
again right away and you are guaranteed to be able to use it.

See the findFreePort() utility function in the embedded agent test:

https://github.com/apache/flume/blob/trunk/flume-ng-embedded-agent/src/test/java/org/apache/flume/agent/embedded/TestEmbeddedAgent.java#L180
                
> TestHTTPSource should use any available port rather than a hardcoded port 
> number
> --------------------------------------------------------------------------------
>
>                 Key: FLUME-2026
>                 URL: https://issues.apache.org/jira/browse/FLUME-2026
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Hari Shreedharan
>            Assignee: Hari Shreedharan
>         Attachments: FLUME-2026.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to