You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by "PDavid (via GitHub)" <gi...@apache.org> on 2026/02/17 13:35:19 UTC

Re: [PR] ZOOKEEPER-5012: guard zkDb close in QuorumPeer shutdown [zookeeper]

PDavid commented on code in PR #2345:
URL: https://github.com/apache/zookeeper/pull/2345#discussion_r2817074295


##########
zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerTest.java:
##########
@@ -80,6 +80,12 @@ public void testQuorumPeerListendOnSpecifiedClientIP(@TempDir File dataDir) thro
         peer2.shutdown();
     }
 
+    @Test
+    public void testShutdownWithoutZkDbDoesNotThrow() throws Exception {
+        QuorumPeer peer = new QuorumPeer();
+        peer.shutdown();

Review Comment:
   Minor idea: Maybe we could use `assertDoesNotThrow()` to signify which method should not throw an Exception.
   
   ```suggestion
           assertDoesNotThrow(peer::shutdown);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org