[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Nauroth updated ZOOKEEPER-2183:
-------------------------------------
    Attachment: ZOOKEEPER-2183.004.patch

[~hdeng], thank you for reviewing.

bq. PortAssignment seems to make assumptions on ant running time.

Unfortunately, I didn't see any other programmatic way to access the thread ID 
so that we can determine a port range.  The thread ID is only available on the 
command line.

If the code is running outside the context of Ant and these properties aren't 
present, then the default behavior is to use the full port range, very similar 
to the existing logic.

bq. A test is highly recommended for setupPortRange() too 

That's a good idea!  :-)  Here is patch v004 adding a test.

> Change test port assignments to improve uniqueness of ports for multiple 
> concurrent test processes on the same host.
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2183
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2183
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: tests
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: ZOOKEEPER-2183.001.patch, ZOOKEEPER-2183.002.patch, 
> ZOOKEEPER-2183.003.patch, ZOOKEEPER-2183.004.patch, threads-change.patch
>
>
> Tests use {{PortAssignment#unique}} for assignment of the ports to bind 
> during tests.  Currently, this method works by using a monotonically 
> increasing counter from a static starting point.  Generally, this is 
> sufficient to achieve uniqueness within a single JVM process, but it does not 
> achieve uniqueness across multiple processes on the same host.  This can 
> cause tests to get bind errors if there are multiple pre-commit jobs running 
> concurrently on the same Jenkins host.  This also prevents running tests in 
> parallel to improve the speed of pre-commit runs.



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

Reply via email to