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

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new d1748573f1c [fix][test] Fix NPE in BookKeeperClusterTestCase tearDown 
(#22493)
d1748573f1c is described below

commit d1748573f1cb294838b69b5d80af672c3ee9e453
Author: Lari Hotari <[email protected]>
AuthorDate: Fri Apr 12 10:09:54 2024 -0700

    [fix][test] Fix NPE in BookKeeperClusterTestCase tearDown (#22493)
---
 .../org/apache/bookkeeper/test/BookKeeperClusterTestCase.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
 
b/managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
index 0ddd04ebc48..a323ecfeb8e 100644
--- 
a/managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
+++ 
b/managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
@@ -86,7 +86,7 @@ public abstract class BookKeeperClusterTestCase {
 
     protected String testName;
 
-    @BeforeMethod
+    @BeforeMethod(alwaysRun = true)
     public void handleTestMethodName(Method method) {
         testName = method.getName();
     }
@@ -148,7 +148,7 @@ public abstract class BookKeeperClusterTestCase {
         }
     }
 
-    @BeforeTest
+    @BeforeTest(alwaysRun = true)
     public void setUp() throws Exception {
         setUp(getLedgersRootPath());
     }
@@ -222,7 +222,9 @@ public abstract class BookKeeperClusterTestCase {
             tearDownException = e;
         }
 
-        executor.shutdownNow();
+        if (executor != null) {
+            executor.shutdownNow();
+        }
 
         LOG.info("Tearing down test {} in {} ms.", testName, 
sw.elapsed(TimeUnit.MILLISECONDS));
         if (tearDownException != null) {

Reply via email to