Hi,

1. Replace the creation of the Registry with TestLibrary.crateRegistryOnEphemeralPort
and call TestLibrary.getRegistryPort to get the port number.

The intent of the test is still satisified without the timing/port allocation issues.

2. Another approach to testing if the port is in use would be to
assume its still active and do a registry.lookup("xxx").

The response be NotBoundException if the registry is still alive
or will be a RemoteException indicating the port is closed.

If some other application has grabbed the port, some other exception RemoteException cause will be thrown.

$.02, Roger


On 10/15/19 5:19 AM, Seán Coffey wrote:
Quite a while since I touched this one! The nature of the test is a bit flaky given that we're assuming no other process will use the chosen port. I'm not sure if a concrete solution is possible. One other option is to have this test run in non-concurrent mode by editing test/jdk/TEST.ROOT --> exclusiveAccess.dirs=

The while loop approach may help but won't protect against cases where a
long running process has attached to the port number we're interested in.

regards,
Sean.

On 15/10/2019 03:20, Weijun Wang wrote:
+SeanC

The wait might unnecessarily increase the test time. Maybe you can do something like this:

    int timeout = 10;
    while (timeout > 0) {
       sleep(one second);
       verifyPortFree && return;
       timeout--;
    }
    throw new Exception(still not freed);

And Sean, back in JDK-8016728 you said "Let's extend it to 1000ms and see how test behaves". So what do you think?

Thanks,
Max

On Oct 15, 2019, at 10:03 AM, Hamlin Li <[email protected]> wrote:

Hi,

The test is failing more frequently, could some help to review it?

Thank you

-Hamlin

On 2019/9/4 11:11 AM, Hamlin Li wrote:
some background & comment: in most of failures, the "test.timeout.factor" is 10.0 or 8.0, so in the test code this factor should be considered in rmi operations such unexporting an object.

Thank you

-Hamlin

On 2019/9/4 11:01 AM, Hamlin Li wrote:
Hi,

Would you please review the following patch?

Bug: https://bugs.openjdk.java.net/browse/JDK-8134599

webrev: http://cr.openjdk.java.net/~mli/8134599/webrev.00/


Thank you

-Hamlin


Reply via email to