You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/27 09:42:33 UTC

[GitHub] [pulsar] lhotari commented on a diff in pull request #17851: [fix][tests] Fix Mockito mocks memory leak

lhotari commented on code in PR #17851:
URL: https://github.com/apache/pulsar/pull/17851#discussion_r981015537


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java:
##########
@@ -304,11 +307,19 @@ protected void stopBroker() throws Exception {
         // set shutdown timeout to 0 for forceful shutdown
         pulsar.getConfiguration().setBrokerShutdownTimeoutMs(0L);
         pulsar.close();
+        cleanupMock(pulsar);
         pulsar = null;
         // Simulate cleanup of ephemeral nodes
         //mockZooKeeper.delete("/loadbalance/brokers/localhost:" + pulsar.getConfiguration().getWebServicePort(), -1);
     }
 
+    protected void cleanupMock(Object mock) {

Review Comment:
   I'm simplifying this. I'll push an update soon. It's sufficient to call Mockito.reset



-- 
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: commits-unsubscribe@pulsar.apache.org

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