Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java 7191877 generic-

java/rmi/registry/readTest/CodebaseTest.java 8173324 windows-all
java/rmi/registry/multipleRegistries/MultipleRegistries.java 8268182 macosx-all

java/rmi/Naming/DefaultRegistryPort.java 8005619 windows-all
java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java 8005619 windows-all

Expand Down
25 changes: 21 additions & 4 deletions test/jdk/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@
import java.io.*;
import java.lang.reflect.*;
import java.rmi.registry.*;
import java.util.concurrent.CountDownLatch;

public class CheckLeaseLeak extends UnicastRemoteObject implements LeaseLeak {
public CheckLeaseLeak() throws RemoteException { }
public void ping () throws RemoteException { }
public void ping () throws RemoteException {
remoteCallsComplete.countDown();
}

/**
* Id to fake the DGC_ID, so we can later get a reference to the
Expand All @@ -75,6 +78,9 @@ public void ping () throws RemoteException { }
private final static int numberPingCalls = 0;
private final static int CHECK_INTERVAL = 400;
private final static int LEASE_VALUE = 20;
private static final int NO_OF_CLIENTS = ITERATIONS;
private static final int GOOD_LUCK_FACTOR = 2;
private static CountDownLatch remoteCallsComplete = new CountDownLatch(NO_OF_CLIENTS);

public static void main (String[] args) {
CheckLeaseLeak leakServer = null;
Expand Down Expand Up @@ -116,8 +122,14 @@ public static void main (String[] args) {
jvm.destroy();
}
}
try {
remoteCallsComplete.await();
System.out.println("remoteCallsComplete . . . ");
} catch (InterruptedException intEx) {
System.out.println("remoteCallsComplete.await interrupted . . . ");
}
Thread.sleep(NO_OF_CLIENTS * LEASE_VALUE * GOOD_LUCK_FACTOR);
numLeft = getDGCLeaseTableSize();
Thread.sleep(3000);

} catch(Exception e) {
TestLibrary.bomb("CheckLeaseLeak Error: ", e);
Expand All @@ -128,7 +140,11 @@ public static void main (String[] args) {
}
}

<<<<<<< HEAD
/* numLeft should be 2 - if 11 there is a problem. */
=======
/* numLeft should not be greater than 2 - if 11 there is a problem. */
>>>>>>> 4b4d0cd35a3 (8365398: TEST_BUG: java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java failing intermittently)
if (numLeft > 2) {
TestLibrary.bomb("Too many objects in DGCImpl.leaseTable: "+
numLeft);
Expand Down Expand Up @@ -213,8 +229,9 @@ public Object run() throws Exception {
* objects if the LeaseInfo memory leak is not fixed.
*/
leaseTable = (Map) f.get(dgcImpl[0]);

numLeaseInfosLeft = leaseTable.size();
synchronized (leaseTable) {
numLeaseInfosLeft = leaseTable.size();
}

} catch(Exception e) {
if (e instanceof java.security.PrivilegedActionException)
Expand Down