You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2017/03/01 08:38:32 UTC

svn commit: r1784874 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document: BlobReferenceIteratorTest.java OrphanedBranchTest.java RevisionGCTest.java

Author: mreutegg
Date: Wed Mar  1 08:38:32 2017
New Revision: 1784874

URL: http://svn.apache.org/viewvc?rev=1784874&view=rev
Log:
OAK-5866: Some tests do not dispose fixture

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java Wed Mar  1 08:38:32 2017
@@ -73,6 +73,7 @@ public class BlobReferenceIteratorTest {
     @After
     public void tearDown() throws Exception {
         store.dispose();
+        fixture.dispose();
     }
     
     @Test

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java Wed Mar  1 08:38:32 2017
@@ -82,6 +82,7 @@ public class OrphanedBranchTest {
     @After
     public void tearDown() throws Exception {
         store.dispose();
+        fixture.dispose();
     }
 
     @Test

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java Wed Mar  1 08:38:32 2017
@@ -72,6 +72,7 @@ public class RevisionGCTest {
         if (store != null) {
             store.dispose();
         }
+        fixture.dispose();
         Revision.resetClockToDefault();
     }
 



Re: svn commit: r1784874 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document: BlobReferenceIteratorTest.java OrphanedBranchTest.java RevisionGCTest.java

Posted by Francesco Mari <ma...@gmail.com>.
The test will fail, but the cleanup after the failed test might run
only partially. I had many cleanup issues myself for the segment store
(e.g. files kept open, unclosed connections), and I found that code
similar to this was the main offender. It was just a gentle warning,
it might be that this problem is irrelevant to the document store!

2017-03-01 13:26 GMT+01:00 Marcel Reutegger <mr...@adobe.com>:
> On 01/03/17 09:55, Francesco Mari wrote:
>>
>> I don't know the implementation of store.dispose() but if that call
>> throws an exception fixture.dispose() will not be invoked. If there is
>> no ordering dependency between store.dispose(), fixture.dispose(), and
>> Revision.resetClockToDefault(), it's more robust to put them in
>> different @After methods.
>
>
> The ordering is important because there are dependencies between the calls.
> store.dispose() may indeed fail with an exception, but that would fail the
> test anyway, right? So, not sure if it is worth fixing all those tests. It's
> not just the three tests that I updated. There are many more that would be
> affected.
>
> Regards
>  Marcel

Re: svn commit: r1784874 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document: BlobReferenceIteratorTest.java OrphanedBranchTest.java RevisionGCTest.java

Posted by Marcel Reutegger <mr...@adobe.com>.
On 01/03/17 09:55, Francesco Mari wrote:
> I don't know the implementation of store.dispose() but if that call
> throws an exception fixture.dispose() will not be invoked. If there is
> no ordering dependency between store.dispose(), fixture.dispose(), and
> Revision.resetClockToDefault(), it's more robust to put them in
> different @After methods.

The ordering is important because there are dependencies between the 
calls. store.dispose() may indeed fail with an exception, but that would 
fail the test anyway, right? So, not sure if it is worth fixing all 
those tests. It's not just the three tests that I updated. There are 
many more that would be affected.

Regards
  Marcel

Re: svn commit: r1784874 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document: BlobReferenceIteratorTest.java OrphanedBranchTest.java RevisionGCTest.java

Posted by Francesco Mari <ma...@gmail.com>.
I don't know the implementation of store.dispose() but if that call
throws an exception fixture.dispose() will not be invoked. If there is
no ordering dependency between store.dispose(), fixture.dispose(), and
Revision.resetClockToDefault(), it's more robust to put them in
different @After methods.

2017-03-01 9:38 GMT+01:00  <mr...@apache.org>:
> Author: mreutegg
> Date: Wed Mar  1 08:38:32 2017
> New Revision: 1784874
>
> URL: http://svn.apache.org/viewvc?rev=1784874&view=rev
> Log:
> OAK-5866: Some tests do not dispose fixture
>
> Modified:
>     jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java
>     jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java
>     jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java
>
> Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java
> URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java (original)
> +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/BlobReferenceIteratorTest.java Wed Mar  1 08:38:32 2017
> @@ -73,6 +73,7 @@ public class BlobReferenceIteratorTest {
>      @After
>      public void tearDown() throws Exception {
>          store.dispose();
> +        fixture.dispose();
>      }
>
>      @Test
>
> Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java
> URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java (original)
> +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/OrphanedBranchTest.java Wed Mar  1 08:38:32 2017
> @@ -82,6 +82,7 @@ public class OrphanedBranchTest {
>      @After
>      public void tearDown() throws Exception {
>          store.dispose();
> +        fixture.dispose();
>      }
>
>      @Test
>
> Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java
> URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java?rev=1784874&r1=1784873&r2=1784874&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java (original)
> +++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionGCTest.java Wed Mar  1 08:38:32 2017
> @@ -72,6 +72,7 @@ public class RevisionGCTest {
>          if (store != null) {
>              store.dispose();
>          }
> +        fixture.dispose();
>          Revision.resetClockToDefault();
>      }
>
>
>