You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/06/01 17:27:46 UTC
svn commit: r780683 -
/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Author: sebb
Date: Mon Jun 1 15:27:22 2009
New Revision: 780683
URL: http://svn.apache.org/viewvc?rev=780683&view=rev
Log:
Increase testEviction2 initial delay by 10% to reduce timing errors
Capture and report visitCounts when "two" checks fail.
Modified:
commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java?rev=780683&r1=780682&r2=780683&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java Mon Jun 1 15:27:22 2009
@@ -449,7 +449,7 @@
pool.returnObject("2",active2[i]);
}
- try { Thread.sleep(1000L); } catch(InterruptedException e) { }
+ try { Thread.sleep(1100L); } catch(InterruptedException e) { }
assertTrue("Should be less than 1000 idle, found " + pool.getNumIdle(),pool.getNumIdle() < 1000);
try { Thread.sleep(600L); } catch(InterruptedException e) { }
assertTrue("Should be less than 900 idle, found " + pool.getNumIdle(),pool.getNumIdle() < 900);
@@ -949,11 +949,17 @@
"totalInstances", totalInstances, zeroLength, oneLength, twoLength));
}
}
+ int visits[] = new int[twoLength];
for (int k = 0; k < twoLength; k++) {
tracker = (VisitTracker) pool.borrowObject(two);
visitCount = tracker.getValidateCount();
+ visits[k] = visitCount;
if (visitCount < cycleCount || visitCount > cycleCount + 1){
- fail(formatSettings("TWO", "runs", runs, "lifo", lifo, "i", i, "j", j,
+ StringBuffer sb = new StringBuffer("Visits:");
+ for (int l = 0; l <= k; l++){
+ sb.append(visits[l]).append(' ');
+ }
+ fail(formatSettings("TWO "+sb.toString(), "runs", runs, "lifo", lifo, "i", i, "j", j,
"k", k, "visitCount", visitCount, "cycleCount", cycleCount,
"totalInstances", totalInstances, zeroLength, oneLength, twoLength));
}