Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/377#discussion_r163746348
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java ---
    @@ -476,9 +474,12 @@ public ZooKeeperServerListener 
getZooKeeperServerListener() {
             return listener;
         }
     
    +    // Visible for testing
    +    static volatile int serverId = 1;
    --- End diff --
    
    Here's the issue @phunt - `serverId` is consumed by 
`ZooKeeperServer.createSessionTracker()`. For tests, the ZooKeeperServer is 
created by the **static** method `ClientBase.startServerInstance()`. So, _I'm_ 
the person down the road that has to deal with the static method created long 
ago. It would take significant re-write for `ClientBase.startServerInstance()` 
to be non-static and parameterized.


---

Reply via email to