Fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=47583
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 19:40:54 +0000 (19:40 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 30 Jul 2009 19:40:54 +0000 (19:40 +0000)
Fix timing related failures.
Patch suggested by sebb

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@799427 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/test/org/apache/tomcat/jdbc/test/TestConcurrency.java

index a39f3ee..23c8990 100644 (file)
@@ -36,8 +36,8 @@ public class TestConcurrency extends DefaultTestCase {
 
     @Override
     protected void tearDown() throws Exception {
-        Driver.reset();
         ds.close(true);
+        Driver.reset();
         super.tearDown();
     }
     
@@ -68,7 +68,7 @@ public class TestConcurrency extends DefaultTestCase {
         }
         try {
             while (loopcount.get()<iter) {
-                assertEquals("Size comparison:",10, ds.getPool().getSize());
+                assertTrue("Size comparison(less than 11):",ds.getPool().getSize()<=10);
                 if (debug) {
                     System.out.println("Size: "+ds.getPool().getSize());
                     System.out.println("Used: "+ds.getPool().getActive());