You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2004/06/23 14:26:58 UTC
cvs commit: db-ojb/src/test/org/apache/ojb/odmg LockingMultithreadedTest.java
arminw 2004/06/23 05:26:58
Modified: src/test/org/apache/ojb/odmg LockingMultithreadedTest.java
Log:
make this test more moderate to let it pass
on "slow-going hardware" too
Revision Changes Path
1.3 +8 -6 db-ojb/src/test/org/apache/ojb/odmg/LockingMultithreadedTest.java
Index: LockingMultithreadedTest.java
===================================================================
RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/LockingMultithreadedTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LockingMultithreadedTest.java 5 Apr 2004 17:11:48 -0000 1.2
+++ LockingMultithreadedTest.java 23 Jun 2004 12:26:58 -0000 1.3
@@ -138,8 +138,8 @@
}
private int counter = 0;
- private static final int maxAttemps = 100;
- private static final int nearMax = (int) (maxAttemps * 0.7);
+ private static final int maxAttempts = 200;
+ private static final int nearMax = (int) (maxAttempts * 0.9);
private void updateObject(Transaction tx, LockObject obj) throws Exception
{
@@ -151,12 +151,14 @@
}
catch (LockNotGrantedException e)
{
- if (counter < maxAttemps)
+ if (counter < maxAttempts)
{
counter++;
if (counter > nearMax)
- LoggerFactory.getDefaultLogger().warn("### thread " + threadNumber
- + " waits " + counter + " times. Maximal attempts are " + maxAttemps);
+ LoggerFactory.getDefaultLogger().warn("LockingMultithreadedTest: thread "
+ + threadNumber + " waits " + counter
+ + " times to update object. Maximal attempts before fail are " + maxAttempts
+ + ". This can be a result of low hardware.");
Thread.sleep(10);
updateObject(tx, obj);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org