Hi Chris,
Instead of creating a socket factory for this purpose, this test can use RMI's
test library TestLibrary.createRegistryOnUnusedPort(). Now, internally, this
uses the now disfavored "getUnusedRandomPort" pattern, but it can (and should)
be changed to avoid this. In, fact, passing 0 will work, though it could use its
own socket factory if necessary. (It would be good to keep this knowledge within
the test library.)
The actual port number in use can be fished out of the registry implementation
by calling TestLibrary.getRegistryPort().
s'marks
On 3/4/15 7:01 AM, Chris Hegarty wrote:
This is a small, test only, review request to fix an intermittently failing
test.
There is an inherent race, and possible failure, following the
getUnusedRandomPort pattern. This test can be modified to use a custom socket
factory, supporting listening on an ephemeral port, without changing the
behavior of the test.
http://cr.openjdk.java.net/~chegar/8005226/webrev.00/webrev/
-Chris.