changeset 16213:08f94540f074

8078587: java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java fails intermittently with Port already in use Reviewed-by: chegar
author mli
date Fri, 02 Dec 2016 02:01:40 -0800
parents 08f81d321087
children bc6c31fd98cf
files test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java	Fri Dec 02 01:11:33 2016 -0800
+++ b/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);