commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r780683 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Date Mon, 01 Jun 2009 15:27:46 GMT
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));
                     }



Mime
View raw message