RFR 8005226: TEST_BUG: java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java fails intermittently

Chris Hegarty chris.hegarty at oracle.com
Wed Mar 4 19:14:59 UTC 2015


> On 4 Mar 2015, at 18:10, Stuart Marks <stuart.marks at oracle.com> wrote:
> 
> 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.)

Sorry, I’m confused. Are you suggesting that I change TestLibrary.createRegistryOnUnusedPort to use a socket factory, similar to the changes in the webrev? Or are you saying that the TestLibrary already supports bind to an ephemeral port and subsequently disclosing that port?

-Chris.

> 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.




More information about the core-libs-dev mailing list