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/10 15:27:17 UTC

[GitHub] [pulsar] tisonkun commented on a diff in pull request #17579: [improve][test] try remove whitebox on MockZooKeeper

tisonkun commented on code in PR #17579:
URL: https://github.com/apache/pulsar/pull/17579#discussion_r967667287


##########
testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java:
##########
@@ -144,10 +144,7 @@ public static MockZooKeeper newInstanceForGlobalZK(ExecutorService executor, int
 
     public static MockZooKeeper newInstance(ExecutorService executor, int readOpDelayMs) {
         try {
-            MockZooKeeper zk = createMockZooKeeperInstance(executor, readOpDelayMs);
-            ObjectInstantiator<ClientCnxn> clientCnxnObjectInstantiator = objenesis.getInstantiatorOf(ClientCnxn.class);
-            Whitebox.setInternalState(zk, "cnxn", clientCnxnObjectInstantiator.newInstance());
-            return zk;
+            return createMockZooKeeperInstance(executor, readOpDelayMs);

Review Comment:
   @eolivelli this change was added by you in https://github.com/apache/pulsar/pull/8590. I don't know why we need this `WhiteBox` based mock and after removing it and running several tests, it seems all green.
   
   Could you share some background here?



-- 
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