8078587: java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java fails intermittently with Port already in use
Reviewed-by: chegar
--- 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);