For finding out the concurrent bug of program,we must prepare some of conditions while during the test:
- enough request stress,it ensures a data is requested by more than one thread save and update
- enough business processes is coverd,the read and the write、the save and the get should simultaneously happen,and the data involved must be extensive
But for distributed test,increasing stress just is one of difficult point,another difficult point is how to resolve test scheduler problem。
Thinking back a typical automatic test process:
- built test logic
- execute test logic
- assert
The test tools which can implement distributed scheduler is complicated by using,we offen have to write many scrips and configuration,and there things needs very high stduty cost,some time after we have learned this,the time of working is very less。
Now with help of zookeeper,we can write a small program for do this,it is very simple and the codes is very short,general several lines。
For zookeeper,I don't Introduce it,because it's information is very more on internet,just only a word,all the action of zookeeper is atomic,and can implement incrementing,we easily implement some of distributed and synchronous arithmetics by this feature。these arithmetics are base of implementing distributed scheduler。
So I have writed a simple test framework:Dispatcher ,only if is userd for illustrating zookeeper's ability on distributed scheduler。
architecture: