It would be good for us to spend a little time thinking about improving the unit tests, especially as we add a lot of tricky logic in 0.8.
Here are some thoughts: - Tests like ZookeeperConsumerConnectorTest are pretty fragile. They are good because they cover a lot of code, but they break a lot, are very dependent on timing assumptions, and they are really hard to debug. - Zookeeper in general has been a difficulty for us. We haven't really established a good way for mocking and testing zk. - For KafkaApis, the "business logic" layer, I think we should follow the pattern of TopicMetadataTest rather than writing integration tests. We could improve on this approach a bit by - Changing the interface to the RequestChannel (in the KAFKA-48 patch) so that the serialization logic is separated from the business logic. Currently we mingle serialization and logic in a way that isn't very helpful. - Having a proper reusable mock for KafkaZookeeper and LogManager - Some other ideas: - It would be useful to have a proper mock for SyncProducer and SimpleConsumer (I think we already have this for SyncProducer...) - For zookeeper stuff (leader election, consumer balancing algorithm, etc) it would be good to implement an object that encapsulates this algorithm and test the correctness of the algorithm running against zookeeper without needing to have a fully integrated set of servers and clients to run this test. TL:DR: Let's write more real unit tests... Other thoughts? -Jay