8078587: java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java fails intermittently with Port already in use
authormli
Fri, 02 Dec 2016 02:01:40 -0800
changeset 42350 9ad19b4f2c78
parent 42349 6975e71fe0c3
child 42351 85ed90be0ae1
8078587: java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java fails intermittently with Port already in use Reviewed-by: chegar
jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
--- a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java	Fri Dec 02 01:11:33 2016 -0800
+++ b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java	Fri Dec 02 02:01:40 2016 -0800
@@ -43,7 +43,6 @@
  *          java.rmi/sun.rmi.transport.tcp
  * @build TestLibrary JavaVM LeaseCheckInterval_Stub SelfTerminator
  * @run main/othervm LeaseCheckInterval
- * @key intermittent
  */
 
 import java.rmi.Remote;
@@ -88,9 +87,8 @@
             UnicastRemoteObject.exportObject(obj);
             System.err.println("exported remote object");
 
-            int registryPort = TestLibrary.getUnusedRandomPort();
-            Registry localRegistry =
-                LocateRegistry.createRegistry(registryPort);
+            Registry localRegistry = TestLibrary.createRegistryOnEphemeralPort();
+            int registryPort = TestLibrary.getRegistryPort(localRegistry);
             System.err.println("created local registry");
 
             localRegistry.bind(BINDING, obj);