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

Vladislav Pernin commented on FLINK-4145:
-----------------------------------------

Wy not using something like :
{code}
    public static int getAvailablePort() {
        ServerSocket ss = null;
        try {
            ss = new ServerSocket(0);
            return ss.getLocalPort();
        } catch (IOException e) {
            throw new IllegalStateException(e);
        } finally {
            if (ss != null && !ss.isClosed()) {
                try {
                    ss.close();
                } catch (IOException e) {
                    throw new IllegalStateException(e);
                }
            }
        }
    }
{code}

> JmxReporterTest fails due to port conflicts
> -------------------------------------------
>
>                 Key: FLINK-4145
>                 URL: https://issues.apache.org/jira/browse/FLINK-4145
>             Project: Flink
>          Issue Type: Bug
>          Components: Local Runtime
>            Reporter: Ufuk Celebi
>            Assignee: Ufuk Celebi
>              Labels: test-stability
>             Fix For: 1.1.0
>
>
> I saw multiple failures of the {{JmxReporterTest}} most likely due to a port 
> conflicts. The test relies on the default JMX reporter port range, which 
> spans 5 ports. Running on Travis with multiple concurrent builds and bad 
> timings, this can lead to port conflicts.
> Some example failed runs:
> https://s3.amazonaws.com/archive.travis-ci.org/jobs/141999066/log.txt (one 
> out of 5 jobs failed)
> https://travis-ci.org/uce/flink/builds/141917901 (all 5 jobs failed)
> I propose to take the fork number into account (like the forkable Flink 
> testing cluster) and configure a larger port range.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to