anchor.diff:      ok.
   
   wait_for_ets_table_ready(Len) ->
  -    io:format("--- ~p~n", [ets:tab2list(etcd_client)]),
       Temp = lists:append([X || {_, X} <- ets:tab2list(etcd_client)]),
       case erlang:length(Temp) == Len of
           true ->
  
positive.code:     [ {etcdc,
         [ test_whole_flow_workernode
         , test_whole_flow_storenode
         , test_etcd_watch
         ]}
      ].
  
negative.code:     {error, etcdc_cache_error} = etcd_client:get_storenode(faketype),
      ok.
  
  test_whole_flow_node(_Config) ->
      {ok, _} = etcd_client:start_link(),
  
      ok = etcd_client:register_workernode(all, 5, 300, 'test1@a'),
      ok = etcd_client:register_workernode(all, 5, 300),
      ok = etcd_client:register_workernode(muc, 5, 300, 'test3'),
      ok = etcd_client:register_workernode(muc, 5, 300, 'test4'),
      ok = etcd_client:watch_workernode_list(100),
  
      ok = etcd_client:register_storenode(all, 5, 300, 'test1@a'),
      ok = etcd_client:register_storenode(all, 5, 300),
      ok = etcd_client:register_storenode(muc, 5, 300, 'test3'),
      ok = etcd_client:register_storenode(muc, 5, 300, 'test4'),
      ok = etcd_client:watch_storenode_list(100),
  
      ok = wait_for_ets_table_ready(8),
  
      timer:sleep(2000),
  
      {ok, WorkerNode1} = etcd_client:get_workernode(all),
      true = lists:member(WorkerNode1, ['test1@a', node()]),
      {ok, WorkerNode2} = etcd_client:get_workernode(muc),
      true = lists:member(WorkerNode2, ['test3', 'test4']),
      {error, empty} = etcd_client:get_workernode(faketype),
  
      {ok, StoreNode1} = etcd_client:get_storenode(all),
      true = lists:member(StoreNode1, ['test1@a', node()]),
      {ok, StoreNode2} = etcd_client:get_storenode(muc),
      true = lists:member(StoreNode2, ['test3', 'test4']),
      {error, empty} = etcd_client:get_storenode(faketype),
  
      ok = etcd_client:stop(),
      {error, etcdc_cache_error} = etcd_client:get_workernode(faketype),
      ok.
  
  test_etcd_watch(_Config) ->
      etcdc:watch("/imstest/ejabberd/workerconfig", [recursive, continous]),
      etcdc:set("/imstest/ejabberd/workerconfig/ejabberd/session_db",
  