From f6f99775bf1929b1dc48a5001318b2ba21a48142 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Sat, 9 May 2009 01:20:22 +0000 Subject: [PATCH] OPENJPA-891 Fine tune test case to optimize runtime duration. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@773149 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/persistence/lockmgr/SequencedActionsTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java index 96ada3849..81bb64477 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java @@ -72,7 +72,7 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase { javax.persistence.PessimisticLockException.class, javax.persistence.LockTimeoutException.class }; - protected static final int MinThreadWaitInMs = 45000; + protected static final int MinThreadWaitInMs = 10000; private long waitInMsec = -1; private String empTableName; @@ -110,7 +110,7 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase { if (waitInMsec == -1) { speedCnt = platformSpeedTest(); try { - waitInMsec = MinThreadWaitInMs + 500000 / (speedCnt / 1000000); + waitInMsec = MinThreadWaitInMs + 250000 / (speedCnt / 1000000); } catch (Throwable t) { } } @@ -534,8 +534,8 @@ public abstract class SequencedActionsTest extends SQLListenerTestCase { if (args.length > 2 && args[2] != null) { waitTime = (Integer) args[2]; } - if( waitTime < 15000) - waitTime = 15000; + if (waitTime < MinThreadWaitInMs / 2) + waitTime = MinThreadWaitInMs / 2; if( waitThreadid != 0) { thisThread.wait(waitTime); } else {