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 re...@apache.org on 2023/08/23 11:19:03 UTC

[jackrabbit-oak] branch trunk updated: OAK-10415: AbstractTwoNodeTest: make teardown more robust (#1083)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new ae7a422c5b OAK-10415: AbstractTwoNodeTest: make teardown more robust (#1083)
ae7a422c5b is described below

commit ae7a422c5b39fe1c95c170ec5a1b6153abad0b46
Author: Julian Reschke <re...@apache.org>
AuthorDate: Wed Aug 23 13:18:56 2023 +0200

    OAK-10415: AbstractTwoNodeTest: make teardown more robust (#1083)
---
 .../oak/plugins/document/AbstractTwoNodeTest.java  | 35 ++++++++++++----------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractTwoNodeTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractTwoNodeTest.java
index de314933ab..464b0ca19a 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractTwoNodeTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/AbstractTwoNodeTest.java
@@ -130,23 +130,26 @@ public class AbstractTwoNodeTest {
 
     @After
     public void tearDown() throws Exception {
-        if (ds1 != null) {
-            ds1.dispose();
+        try {
+            if (ds2 != null) {
+                ds2.dispose();
+            }
+            if (ds1 != null) {
+                ds1.dispose();
+            }
+            if (store2 != null) {
+                store2.dispose();
+            }
+            if (store1 != null) {
+                store1.dispose();
+            }
+            if (fixture != null) {
+                fixture.dispose();
+            }
+        } finally {
+            ClusterNodeInfo.resetClockToDefault();
+            Revision.resetClockToDefault();
         }
-        if (ds2 != null) {
-            ds2.dispose();
-        }
-        if (store1 != null) {
-            store1.dispose();
-        }
-        if (store2 != null) {
-            store2.dispose();
-        }
-        if (fixture != null) {
-            fixture.dispose();
-        }
-        ClusterNodeInfo.resetClockToDefault();
-        Revision.resetClockToDefault();
     }
 
     private static DocumentStore wrap(DocumentStore ds) {