commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r897720 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
Date Sun, 10 Jan 2010 22:07:17 GMT
Author: psteitz
Date: Sun Jan 10 22:07:16 2010
New Revision: 897720

URL: http://svn.apache.org/viewvc?rev=897720&view=rev
Log:
Allow threads sufficient time to complete in multipleThreads.

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java?rev=897720&r1=897719&r2=897720&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java Sun
Jan 10 22:07:16 2010
@@ -713,11 +713,14 @@
                     (pts[i] = new PoolTest(threadGroup, holdTime, expectError, loopOnce)).start();
   
                 }
 
-                Thread.sleep(100L); // Wait for long enough to allow threads to start
+                // Give all threads a chance to start and succeed
+                Thread.sleep(Math.max(100l, 3 * maxWait));
 
+                // Stop threads
                 for (int i = 0; i < pts.length; i++) {
                     pts[i].stop();
-                }
+                }   
+                
                 /*
                  * Wait for all threads to terminate.
                  * This is essential to ensure that all threads have a chance to update success[0]



Mime
View raw message