The code coverage of client-java is insufficient. Planty of code logic can be only covered by the internal integration tests without more granular unit tests. There is a pull request: https://github.com/tikv/client-java/pull/518 on the way that is trying to increase the coverage of the retry logic of RawKVClient. However, this is not enough, we still get plenty of TODOs.
Including:
[x] UT for AbstractRegionStoreClient
[ ] UT for RegionErrorHandler
[ ] UT for Backoffer
These may introduce us a more important problem: build a scalable mock server for TiKV and PD:
[ ] Refactor the KVMockServer and PDMockServer, make it more easy to use and cover more errors.
When a getRegion RPC is made, the callback will be triggered.
This design might make it more flexible to mock everything the test caller need but may result in more repeat some "server"'s code in the tests. We might need to discuss if this design could fit our needs. If it does, the same refactoring could be applied to KVMockServer.
Feature Request
The code coverage of
client-java
is insufficient. Planty of code logic can be only covered by the internal integration tests without more granular unit tests. There is a pull request: https://github.com/tikv/client-java/pull/518 on the way that is trying to increase the coverage of the retry logic ofRawKVClient
. However, this is not enough, we still get plenty of TODOs.Including:
AbstractRegionStoreClient
RegionErrorHandler
Backoffer
These may introduce us a more important problem: build a scalable mock server for
TiKV
andPD
:KVMockServer
andPDMockServer
, make it more easy to use and cover more errors.For now,
PDMockServer
is partially refactored by https://github.com/tikv/client-java/pull/518. It supports registering callbacks for gRPC service methods. Just like:When a getRegion RPC is made, the callback will be triggered.
This design might make it more flexible to mock everything the test caller need but may result in more repeat some "server"'s code in the tests. We might need to discuss if this design could fit our needs. If it does, the same refactoring could be applied to
KVMockServer
.