summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/junit/com/jogamp/junit/util/SingletonJunitCase.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/junit/com/jogamp/junit/util/SingletonJunitCase.java b/src/junit/com/jogamp/junit/util/SingletonJunitCase.java
index d7eab35..2552142 100644
--- a/src/junit/com/jogamp/junit/util/SingletonJunitCase.java
+++ b/src/junit/com/jogamp/junit/util/SingletonJunitCase.java
@@ -41,7 +41,7 @@ public abstract class SingletonJunitCase extends JunitTracer {
public static final int SINGLE_INSTANCE_LOCK_PORT = 59999;
public static final long SINGLE_INSTANCE_LOCK_TO = 12*60*1000; // wait up to 12 mins
- public static final long SINGLE_INSTANCE_LOCK_POLL = 1000; // poll every 1s
+ public static final long SINGLE_INSTANCE_LOCK_POLL = 500; // poll every 500 ms
private static SingletonInstance singletonInstance = null; // system wide lock via port locking
private static final Object singletonSync = new Object(); // classloader wide lock
@@ -69,6 +69,10 @@ public abstract class SingletonJunitCase extends JunitTracer {
System.gc(); // force cleanup
System.err.println("++++ Test Singleton.unlock()");
singletonInstance.unlock();
+ try {
+ // 3 s sleep, allowing other instances to pick-up socket
+ Thread.sleep(3 * 2 * SINGLE_INSTANCE_LOCK_POLL);
+ } catch (final InterruptedException e) { }
}
}
}