jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1325270 - /jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java
Date Thu, 12 Apr 2012 14:08:56 GMT
Author: thomasm
Date: Thu Apr 12 14:08:56 2012
New Revision: 1325270

URL: http://svn.apache.org/viewvc?rev=1325270&view=rev
Log:
OAK-58 connection leak in test case
OAK-60 occasional test case failure DbBlobStoreTest#testGarbageCollection

Modified:
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java?rev=1325270&r1=1325269&r2=1325270&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/DbBlobStoreTest.java
Thu Apr 12 14:08:56 2012
@@ -44,10 +44,11 @@ public class DbBlobStoreTest extends Tes
 
     protected AbstractBlobStore store;
     private Connection sentinel;
+    private JdbcConnectionPool cp;
 
     public void setUp() throws Exception {
         Class.forName("org.h2.Driver");
-        JdbcConnectionPool cp = JdbcConnectionPool.create("jdbc:h2:mem:", "", "");
+        cp = JdbcConnectionPool.create("jdbc:h2:mem:", "", "");
         sentinel = cp.getConnection();
         DbBlobStore blobStore = new DbBlobStore();
         blobStore.setConnectionPool(cp);
@@ -61,6 +62,7 @@ public class DbBlobStoreTest extends Tes
             sentinel.close();
         }
         store.close();
+        cp.dispose();
     }
 
     public void testAddFile() throws Exception {
@@ -213,10 +215,11 @@ public class DbBlobStoreTest extends Tes
         store.clearCache();
 
         // https://issues.apache.org/jira/browse/OAK-60
+        // endure there is at least one old entry (with age 1 ms)
         try {
             Thread.sleep(1);
         } catch (InterruptedException e) {
-
+            // ignore
         }
 
         store.startMark();



Mime
View raw message