[
https://issues.apache.org/jira/browse/GEODE-5674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Owen Nichols closed GEODE-5674.
-------------------------------
> Stop picking ports randomly for tests
> -------------------------------------
>
> Key: GEODE-5674
> URL: https://issues.apache.org/jira/browse/GEODE-5674
> Project: Geode
> Issue Type: Improvement
> Reporter: Dan Smith
> Assignee: Brian Rowe
> Priority: Major
> Labels: pull-request-available, swat
> Fix For: 1.9.0
>
> Time Spent: 3h
> Remaining Estimate: 0h
>
> Our tests currently use AvailablePortHelper and AvailablePort to find a
> random port that is not in use.
> However, this can lead to port collisions because after the port is returned,
> it is available until something binds to that socket. In the mean time, other
> calls to getAvailablePort can return the same port, with around 0.01% chance,
> since the range is 10000 ports.
> If we did not pick ports randomly, but instead iterated over a pool of ports,
> we would not return the same port twice until exhaust the pool. We therefore
> not get the same port twice in a test.
> We would need to handle the fact that dunit tests have multiple VMs, so we
> need either a central available port service or a unique pool of ports for
> each process or something like that.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)