[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16938241#comment-16938241
 ] 

Michael Han commented on ZOOKEEPER-3557:
----------------------------------------

This sounds a useful improvement.

On a side note, we have improved TestableZooKeeper internally so it can serve 
as a testable zookeeper cluster for various client teams who integrates with 
ZooKeeper - the TestableZooKeeper accepts various commands to simulate misc 
server conditions (e.g. trigger a leader election, or reject requests). This 
utility currently depends on some of our internal code base, and we are 
rewriting part of it so this can be contributed upstream. I think this can 
address part of this umbrella issue. 

> Towards a testable codebase
> ---------------------------
>
>                 Key: ZOOKEEPER-3557
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3557
>             Project: ZooKeeper
>          Issue Type: Task
>          Components: tests
>            Reporter: Zili Chen
>            Priority: Major
>
> This issue is umbrella issue tracks all efforts towards a testable ZooKeeper 
> codebase.
> *Motivation*
> On the one hand, many of our adopters such as HBase, Curator and so on 
> maintain their own testkit for ZooKeeper[1][2]; on the other hand, ZooKeeper 
> itself doesn't have a well-designed testkit. Here are some of issues in our 
> testing "framework".
> 1. {{ZooKeeperTestable}} becomes a production scope class while it should be 
> in testing scope.
> 2. {{ZooKeeperTestable}} is only used in {{SessionTimeoutTest}} while its 
> name infers a completed testing class.
> 3. {{ClientBase}} is super class of many of zookeeper tests while it contains 
> too many orthogonal functions that its subclass inherits lots of burdens that 
> is not required.
> 4. Testing logics are injected casually so that we suffer from visibility 
> chaos.
> ...
> Due to ZooKeeper doesn't provide testkit our adopters have to write ZK 
> relative tests with quite internal concepts. For example, HBase wait for ZK 
> server launched by 4 letter words which causes issue when upgrade from ZK 
> 3.4.x to ZK 3.5.5 where 4 letter words are disabled by default.
> [1] 
> https://github.com/apache/hbase/blob/master/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
> [2] 
> https://github.com/apache/curator/blob/master/curator-test/src/main/java/org/apache/curator/test/TestingCluster.java



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to